diff --git a/scripts/stages/1/game_manager.gd b/scripts/stages/1/game_manager.gd index 55cc994..daedc8e 100644 --- a/scripts/stages/1/game_manager.gd +++ b/scripts/stages/1/game_manager.gd @@ -87,7 +87,7 @@ func on_enemy_entered_base(enemy): $CanvasLayer/GameStats.set_damage(enemy.damage) if data['health'] < 1: - print("Game Over") + get_tree().change_scene_to_file("res://scenes/ui/defeat.tscn") func on_enemy_reward(value: int): data['resource'] += value diff --git a/scripts/stages/2/game_manager.gd b/scripts/stages/2/game_manager.gd index e9b5691..e27f209 100644 --- a/scripts/stages/2/game_manager.gd +++ b/scripts/stages/2/game_manager.gd @@ -86,7 +86,7 @@ func on_enemy_entered_base(enemy): $CanvasLayer/GameStats.set_damage(enemy.damage) if data['health'] < 1: - print("Game Over") + get_tree().change_scene_to_file("res://scenes/ui/defeat.tscn") func on_enemy_reward(value: int): data['resource'] += value diff --git a/scripts/stages/3/game_manager.gd b/scripts/stages/3/game_manager.gd index 45b5bbc..4033aed 100644 --- a/scripts/stages/3/game_manager.gd +++ b/scripts/stages/3/game_manager.gd @@ -86,7 +86,7 @@ func on_enemy_entered_base(enemy): $CanvasLayer/GameStats.set_damage(enemy.damage) if data['health'] < 1: - print("Game Over") + get_tree().change_scene_to_file("res://scenes/ui/defeat.tscn") func on_enemy_reward(value: int): data['resource'] += value diff --git a/scripts/stages/4/game_manager.gd b/scripts/stages/4/game_manager.gd index 54a8892..315b8cb 100644 --- a/scripts/stages/4/game_manager.gd +++ b/scripts/stages/4/game_manager.gd @@ -86,7 +86,7 @@ func on_enemy_entered_base(enemy): $CanvasLayer/GameStats.set_damage(enemy.damage) if data['health'] < 1: - print("Game Over") + get_tree().change_scene_to_file("res://scenes/ui/defeat.tscn") func on_enemy_reward(value: int): data['resource'] += value diff --git a/scripts/stages/5/game_manager.gd b/scripts/stages/5/game_manager.gd index d9f0cbb..f642271 100644 --- a/scripts/stages/5/game_manager.gd +++ b/scripts/stages/5/game_manager.gd @@ -86,7 +86,7 @@ func on_enemy_entered_base(enemy): $CanvasLayer/GameStats.set_damage(enemy.damage) if data['health'] < 1: - print("Game Over") + get_tree().change_scene_to_file("res://scenes/ui/defeat.tscn") func on_enemy_reward(value: int): data['resource'] += value diff --git a/scripts/stages/6/game_manager.gd b/scripts/stages/6/game_manager.gd index 0384bff..a8f25ce 100644 --- a/scripts/stages/6/game_manager.gd +++ b/scripts/stages/6/game_manager.gd @@ -86,7 +86,7 @@ func on_enemy_entered_base(enemy): $CanvasLayer/GameStats.set_damage(enemy.damage) if data['health'] < 1: - print("Game Over") + get_tree().change_scene_to_file("res://scenes/ui/defeat.tscn") func on_enemy_reward(value: int): data['resource'] += value