diff --git a/scripts/game_controller.gd b/scripts/game_controller.gd index 49039df..5f5acd4 100644 --- a/scripts/game_controller.gd +++ b/scripts/game_controller.gd @@ -59,6 +59,12 @@ func _process(_delta: float) -> void: load_game() pass +func reset() -> void: + print_debug("Resetting the level") + enemies_dict.clear() + player_current_health = player_stats["starting_health"] + time_available = timers[current_level] + func second_counter() -> void: time_available -= 1 timer_updated.emit(time_available) @@ -66,12 +72,6 @@ func second_counter() -> void: print_debug("You ran out of time! Emitting level_changed signal") level_changed.emit(levels[current_level]) -func reset() -> void: - print_debug("Resetting the level") - enemies_dict.clear() - player_current_health = player_stats["starting_health"] - time_available = timers[current_level] - func on_coin_collected(_body, coin) -> void: print_debug("GC knows coin collected") diff --git a/scripts/scene_manager.gd b/scripts/scene_manager.gd index 9182ab3..1e7f149 100644 --- a/scripts/scene_manager.gd +++ b/scripts/scene_manager.gd @@ -20,7 +20,6 @@ func _ready() -> void: GameController.reset() build_level() - func _on_world_boundary_body_entered(body: Node2D) -> void: if body is Player: var current_scene = get_tree() @@ -30,7 +29,6 @@ func build_level() -> void: if coins: update_coins() - var _total_enemies : int = 0 if enemies: update_enemies() # Wire up signals