From f86d6295d5fb4dfb9c2f70f57c239843ecdbb884 Mon Sep 17 00:00:00 2001 From: Moe Poi ~ Date: Wed, 25 Oct 2023 17:50:03 +0700 Subject: [PATCH] Clear some components after defeat --- scripts/stages/1/game_manager.gd | 6 ++++++ scripts/stages/2/game_manager.gd | 8 +++++++- scripts/stages/3/game_manager.gd | 6 ++++++ scripts/stages/4/game_manager.gd | 6 ++++++ scripts/stages/5/game_manager.gd | 6 ++++++ scripts/stages/6/game_manager.gd | 6 ++++++ 6 files changed, 37 insertions(+), 1 deletion(-) diff --git a/scripts/stages/1/game_manager.gd b/scripts/stages/1/game_manager.gd index 4e61692..cad6938 100644 --- a/scripts/stages/1/game_manager.gd +++ b/scripts/stages/1/game_manager.gd @@ -105,6 +105,12 @@ func on_enemy_entered_base(enemy): if data['health'] < 1: get_tree().paused = true + + # Clear some components + $CanvasLayer/TowerMenu.hide() + $CanvasLayer/GameStats.hide() + $CanvasLayer/GameDuration.hide() + $CanvasLayer/Defeat.show() $CanvasLayer/Defeat/AudioStreamPlayer.play() diff --git a/scripts/stages/2/game_manager.gd b/scripts/stages/2/game_manager.gd index 181c9b8..16d7ae8 100644 --- a/scripts/stages/2/game_manager.gd +++ b/scripts/stages/2/game_manager.gd @@ -104,6 +104,12 @@ func on_enemy_entered_base(enemy): if data['health'] < 1: get_tree().paused = true + + # Clear some components + $CanvasLayer/TowerMenu.hide() + $CanvasLayer/GameStats.hide() + $CanvasLayer/GameDuration.hide() + $CanvasLayer/Defeat.show() $CanvasLayer/Defeat/AudioStreamPlayer.play() @@ -118,7 +124,7 @@ func _on_duration_timeout(): $CanvasLayer/TowerMenu.hide() $CanvasLayer/GameStats.hide() $CanvasLayer/GameDuration.hide() - + $CanvasLayer/Victory.unlock_next_stage() $CanvasLayer/Victory.show() $CanvasLayer/Victory/AudioStreamPlayer.play() \ No newline at end of file diff --git a/scripts/stages/3/game_manager.gd b/scripts/stages/3/game_manager.gd index 05da798..c5ce368 100644 --- a/scripts/stages/3/game_manager.gd +++ b/scripts/stages/3/game_manager.gd @@ -104,6 +104,12 @@ func on_enemy_entered_base(enemy): if data['health'] < 1: get_tree().paused = true + + # Clear some components + $CanvasLayer/TowerMenu.hide() + $CanvasLayer/GameStats.hide() + $CanvasLayer/GameDuration.hide() + $CanvasLayer/Defeat.show() $CanvasLayer/Defeat/AudioStreamPlayer.play() diff --git a/scripts/stages/4/game_manager.gd b/scripts/stages/4/game_manager.gd index 0281ead..b8dd276 100644 --- a/scripts/stages/4/game_manager.gd +++ b/scripts/stages/4/game_manager.gd @@ -104,6 +104,12 @@ func on_enemy_entered_base(enemy): if data['health'] < 1: get_tree().paused = true + + # Clear some components + $CanvasLayer/TowerMenu.hide() + $CanvasLayer/GameStats.hide() + $CanvasLayer/GameDuration.hide() + $CanvasLayer/Defeat.show() $CanvasLayer/Defeat/AudioStreamPlayer.play() diff --git a/scripts/stages/5/game_manager.gd b/scripts/stages/5/game_manager.gd index 0dc16a2..732d558 100644 --- a/scripts/stages/5/game_manager.gd +++ b/scripts/stages/5/game_manager.gd @@ -104,6 +104,12 @@ func on_enemy_entered_base(enemy): if data['health'] < 1: get_tree().paused = true + + # Clear some components + $CanvasLayer/TowerMenu.hide() + $CanvasLayer/GameStats.hide() + $CanvasLayer/GameDuration.hide() + $CanvasLayer/Defeat.show() $CanvasLayer/Defeat/AudioStreamPlayer.play() diff --git a/scripts/stages/6/game_manager.gd b/scripts/stages/6/game_manager.gd index c3204e2..410e36b 100644 --- a/scripts/stages/6/game_manager.gd +++ b/scripts/stages/6/game_manager.gd @@ -104,6 +104,12 @@ func on_enemy_entered_base(enemy): if data['health'] < 1: get_tree().paused = true + + # Clear some components + $CanvasLayer/TowerMenu.hide() + $CanvasLayer/GameStats.hide() + $CanvasLayer/GameDuration.hide() + $CanvasLayer/Defeat.show() $CanvasLayer/Defeat/AudioStreamPlayer.play()