From e889d131f728cdd06587cb5c0a31f96e4e16a12c Mon Sep 17 00:00:00 2001 From: Kilokem Date: Wed, 27 Aug 2025 22:57:18 +0200 Subject: [PATCH] Pause game for both paths --- Game/Maps/map_2.gd | 6 +++++- Game/Maps/map_2.tscn | 4 ++-- Game/sidepanel.gd | 18 ++++++++++++------ 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/Game/Maps/map_2.gd b/Game/Maps/map_2.gd index 6931f3a..96706f1 100644 --- a/Game/Maps/map_2.gd +++ b/Game/Maps/map_2.gd @@ -40,7 +40,11 @@ var endwave = false func _on_timer_timeout() -> void: if pause <= 0: if endwave: - if not get_node("Path2D").get_children(): + var checkend = false + for i in paths: + if not i.get_children(): + checkend = true + if checkend: endwave = false get_node("CanvasLayer/SidePanel").Update_waves(currentwave + 1) #updating waves if currentwave >= 4: #!!!!! CHECKS FOR THE LAST WAVE IF NEW WAVES ARE ADDED CHANGE ACCORDINGLY!!! diff --git a/Game/Maps/map_2.tscn b/Game/Maps/map_2.tscn index 5f4af8f..9a76688 100644 --- a/Game/Maps/map_2.tscn +++ b/Game/Maps/map_2.tscn @@ -506,9 +506,9 @@ point_count = 15 [sub_resource type="Curve2D" id="Curve2D_xx2jp"] _data = { -"points": PackedVector2Array(0, 0, 0, 0, 1152, 320, 0, 0, 0, 0, 960, 320, 0, 0, 0, 0, 64, 320, 0, 0, 0, 0, 32, 320, 0, 0, 0, 0, 32, 480, 0, 0, 0, 0, 1144, 480, 0, 0, 0, 0, 1152, 320) +"points": PackedVector2Array(0, 0, 0, 0, 1152, 320, 0, 0, 0, 0, 960, 320, 0, 0, 0, 0, 64, 320, 0, 0, 0, 0, 32, 320, 0, 0, 0, 0, 32, 480, 0, 0, 0, 0, 936, 480) } -point_count = 7 +point_count = 6 [sub_resource type="RectangleShape2D" id="RectangleShape2D_rec5e"] size = Vector2(864, 1) diff --git a/Game/sidepanel.gd b/Game/sidepanel.gd index 0a88de0..2bef815 100644 --- a/Game/sidepanel.gd +++ b/Game/sidepanel.gd @@ -161,8 +161,10 @@ func _unhandled_input(event): if event.pressed and event.keycode == KEY_ESCAPE: get_node("pausemenu").show() get_node("Panel").hide() - for i in get_node("../../Path2D").get_children(): - i.get_children()[0].set_process(false) + for i in get_parent().get_parent().get_children(): + if i.name.contains("Path2D"): + for ii in i.get_children(): + ii.get_children()[0].set_process(false) for i in get_parent().get_children(): if i.name != "sidepanel": @@ -178,8 +180,10 @@ func _unhandled_input(event): func GameOver() -> void: get_node("Panel").hide() get_node("GameOver").show() - for i in get_node("../../Path2D").get_children(): - i.get_children()[0].set_process(false) + for i in get_parent().get_parent().get_children(): + if i.name.contains("Path2D"): + for ii in i.get_children(): + ii.get_children()[0].set_process(false) for i in get_parent().get_children(): if i.name != "sidepanel": @@ -205,8 +209,10 @@ func GameWon() -> void: func _on_button_3_pressed() -> void: get_node("pausemenu").hide() get_node("Panel").show() - for i in get_node("../../Path2D").get_children(): - i.get_children()[0].set_process(true) + for i in get_parent().get_parent().get_children(): + if i.name.contains("Path2D"): + for ii in i.get_children(): + ii.get_children()[0].set_process(true) for i in get_parent().get_children(): if i.name != "sidepanel":