diff --git a/Nodes/UI.tscn b/Nodes/UI.tscn index dd6dea8..83a320b 100644 --- a/Nodes/UI.tscn +++ b/Nodes/UI.tscn @@ -1,8 +1,12 @@ -[gd_scene load_steps=3 format=3 uid="uid://cys06pnxfjl2m"] +[gd_scene load_steps=5 format=3 uid="uid://cys06pnxfjl2m"] [ext_resource type="Texture2D" uid="uid://b8rsm7uapp583" path="res://undefined - Imgur (1).png" id="1_cb7ct"] [ext_resource type="Texture2D" uid="uid://44lfs83sax35" path="res://undefined - Imgur.png" id="2_udann"] +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_fir3c"] + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_oa1ad"] + [node name="Control" type="Control"] layout_mode = 3 anchors_preset = 13 @@ -33,6 +37,8 @@ grow_horizontal = 2 grow_vertical = 2 pivot_offset = Vector2(32, 0) theme_override_icons/grabber_disabled = ExtResource("1_cb7ct") +theme_override_styles/grabber_area = SubResource("StyleBoxTexture_fir3c") +max_value = 150.0 editable = false scrollable = false @@ -46,5 +52,8 @@ offset_right = -20.0 grow_horizontal = 2 grow_vertical = 2 theme_override_icons/grabber_disabled = ExtResource("2_udann") +theme_override_styles/grabber_area = SubResource("StyleBoxTexture_oa1ad") +max_value = 150.0 +value = 50.0 editable = false scrollable = false diff --git a/scripts/Logic/Game.gd b/scripts/Logic/Game.gd index 88ddb81..8ae7485 100644 --- a/scripts/Logic/Game.gd +++ b/scripts/Logic/Game.gd @@ -45,11 +45,11 @@ func _process(delta): p1_train.current_distance += p1_train.current_speed * delta p2_train.current_distance += p2_train.current_speed * delta p1_train.distance_from_start += p1_train.current_speed * delta - p2_train.distance_from_start += p1_train.current_speed * delta + p2_train.distance_from_start += p2_train.current_speed * delta - if(p1_node == StartNode && p1_train.distance_from_start > 5): + if(p1_node == StartNode && p1_train.distance_from_start > 15): p1_train.distance_from_start = 0 - if(p2_node == StartNode && p2_train.distance_from_start > 5): + if(p2_node == StartNode && p2_train.distance_from_start > 15): p2_train.distance_from_start = 0 if(p1_train.current_distance >= p1_node.LENGTH): @@ -75,6 +75,11 @@ func _process(delta): tween.tween_property(p1_train, "position",new_pos_p1, 1) tween.tween_property(p2_train, "position",new_pos_p2, 1) tween.tween_property($Control/Panel, "custom_minimum_size", Vector2(0,0), 1) + tween.tween_property($Control/VSlider,"scale",Vector2(0,0),1) + tween.tween_property($Control/VSlider2,"scale",Vector2(0,0),1) + p1_train.current_speed *= 0.5 + p2_train.current_speed *= 0.5 + elif(fight_state == FIGHTING): fight_state = CHILL @@ -86,9 +91,15 @@ func _process(delta): tween.tween_property(p1_train, "position",initial_pos_p1, 1) tween.tween_property(p2_train, "position", initial_pos_p2, 1) tween.tween_property($Control/Panel, "custom_minimum_size", Vector2(15,0), 1) + tween.tween_property($Control/VSlider,"scale",Vector2(1,1),1) + tween.tween_property($Control/VSlider2,"scale",Vector2(1,1),1) + p1_train.current_speed *= 2 + p2_train.current_speed *= 2 + if Input.is_action_pressed("test"): emit_signal("shoot") + $Control/VSlider.value = p1_train.distance_from_start $Control/VSlider2.value = p2_train.distance_from_start