From cd4970b2dc7f8b473bc22b1286f1dd0528a0c572 Mon Sep 17 00:00:00 2001 From: PfandBoss <68470553+PfandBoss@users.noreply.github.com> Date: Sat, 10 Dec 2022 13:20:33 +0100 Subject: [PATCH] push ui --- Nodes/UI.tscn | 9 ++++++--- scripts/Logic/Game.gd | 6 +++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Nodes/UI.tscn b/Nodes/UI.tscn index dce29a5..dd6dea8 100644 --- a/Nodes/UI.tscn +++ b/Nodes/UI.tscn @@ -11,6 +11,7 @@ anchor_right = 0.5 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 +size_flags_horizontal = 4 [node name="Panel" type="Panel" parent="."] custom_minimum_size = Vector2(15, 0) @@ -26,9 +27,11 @@ anchors_preset = 13 anchor_left = 0.5 anchor_right = 0.5 anchor_bottom = 1.0 -offset_left = -16.0 +offset_left = 20.0 +offset_right = 36.0 grow_horizontal = 2 grow_vertical = 2 +pivot_offset = Vector2(32, 0) theme_override_icons/grabber_disabled = ExtResource("1_cb7ct") editable = false scrollable = false @@ -38,8 +41,8 @@ anchors_preset = 13 anchor_left = 0.5 anchor_right = 0.5 anchor_bottom = 1.0 -offset_left = 16.0 -offset_right = 32.0 +offset_left = -36.0 +offset_right = -20.0 grow_horizontal = 2 grow_vertical = 2 theme_override_icons/grabber_disabled = ExtResource("2_udann") diff --git a/scripts/Logic/Game.gd b/scripts/Logic/Game.gd index 23b49df..88ddb81 100644 --- a/scripts/Logic/Game.gd +++ b/scripts/Logic/Game.gd @@ -30,7 +30,7 @@ func _ready(): p2_node = StartNode p2_train.get_node("CharacterBody3D").is_player1 = false p2_train.is_P1 = false - p1_train.current_speed = 5 + p1_train.current_speed = 10 p1_train.hit.connect(_on_hit_player) p2_train.hit.connect(_on_hit_player) @@ -90,7 +90,7 @@ func _process(delta): if Input.is_action_pressed("test"): emit_signal("shoot") - $Control/VSlider.value = p1_train.current_distance - $Control/VSlider2.value = p2_train.current_distance + $Control/VSlider.value = p1_train.distance_from_start + $Control/VSlider2.value = p2_train.distance_from_start