From b9c05c7ac389fc4216f5f079b0cb776f0d53cdbb Mon Sep 17 00:00:00 2001 From: rsxri Date: Thu, 15 Aug 2024 22:55:44 +0100 Subject: [PATCH] add flight assist toggle and corresponding label for it --- MB_FYP/scenes/game.tscn | 1 - MB_FYP/scenes/hud.tscn | 9 +++++++++ MB_FYP/script/game.cs | 15 +++++++++++++++ MB_FYP/script/hud.cs | 5 +++++ MB_FYP/script/player.cs | 25 ++++++++++++++++++++----- 5 files changed, 49 insertions(+), 6 deletions(-) diff --git a/MB_FYP/scenes/game.tscn b/MB_FYP/scenes/game.tscn index b7252c5..8f8d8fc 100644 --- a/MB_FYP/scenes/game.tscn +++ b/MB_FYP/scenes/game.tscn @@ -16,7 +16,6 @@ script = ExtResource("1_dukjm") position = Vector2(800, 450) scale = Vector2(0.6, 0.6) collision_layer = 8 -color = 1 type = 1 [node name="Lasers" type="Node" parent="."] diff --git a/MB_FYP/scenes/hud.tscn b/MB_FYP/scenes/hud.tscn index d6ffd22..17db4f7 100644 --- a/MB_FYP/scenes/hud.tscn +++ b/MB_FYP/scenes/hud.tscn @@ -27,3 +27,12 @@ offset_right = 384.0 offset_bottom = 167.0 text = "Health:" label_settings = ExtResource("2_ns78v") + +[node name="FlightAssist" type="Label" parent="."] +layout_mode = 0 +offset_left = 19.0 +offset_top = 174.0 +offset_right = 226.0 +offset_bottom = 237.0 +text = "FA: ON" +label_settings = ExtResource("2_ns78v") diff --git a/MB_FYP/script/game.cs b/MB_FYP/script/game.cs index dbf83de..df8442f 100644 --- a/MB_FYP/script/game.cs +++ b/MB_FYP/script/game.cs @@ -13,6 +13,8 @@ public partial class game : Node2D public Label HealthLabel = null; + public Label FlightAssistLabel = null; + public hud h; @@ -24,6 +26,7 @@ public partial class game : Node2D { HUD = GetNode("UI/HUD"); ScoreLabel = GetNode