From 52dac4623d2a79bdae7ddedde3d37641df02564c Mon Sep 17 00:00:00 2001 From: Cookie-CHR Date: Tue, 5 Apr 2022 01:03:20 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20Link=20to=20bad=20ending?= =?UTF-8?q?=20(broken=20replay)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/levels/Game.gd | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/src/levels/Game.gd b/src/levels/Game.gd index deeb8f1..595d5e7 100644 --- a/src/levels/Game.gd +++ b/src/levels/Game.gd @@ -14,8 +14,32 @@ func _ready(): func _on_MainMenu_Play_pressed(): - print("Moving to the first phase...") $MainMenu.queue_free() + _on_Play_pressed() + + +func _on_Fire_died(_origin, _value): + print("Should move to the second phase...") + + $PhaseOne.queue_free() + add_child(bad_ending.instance()) + # warning-ignore: RETURN_VALUE_DISCARDED + $BadEnding/TheDarkNightUI/Play.connect("pressed", self, "_on_BadEnding_Replay_pressed") + +func _on_Player_died(_origin, _value): + print("Should display a bad end...") + + $PhaseOne.queue_free() + add_child(bad_ending.instance()) + # warning-ignore: RETURN_VALUE_DISCARDED + $BadEnding/TheDarkNightUI/Play.connect("pressed", self, "_on_BadEnding_Replay_pressed") + +func _on_BadEnding_Replay_pressed(): + $BadEnding.queue_free() + _on_Play_pressed() + +func _on_Play_pressed(): + print("Moving to the first phase...") add_child(phase_one.instance()) add_child(user_interface.instance()) # warning-ignore: RETURN_VALUE_DISCARDED @@ -28,10 +52,3 @@ func _on_MainMenu_Play_pressed(): $UserInterface/TheDarkNightUI/MuteButton.connect("toggled", $Music, "_on_MuteButton_toggled") # warning-ignore: RETURN_VALUE_DISCARDED $PhaseOne/Entities/PhaseOnePlayer/Damageable.connect("health_changed", $UserInterface/TheDarkNightUI/HealthBar, "_on_PhaseOnePlayer_health_changed") - - -func _on_Fire_died(_origin, _value): - print("Should move to the second phase...") - -func _on_Player_died(_origin, _value): - print("Should display a bad end...")