From 5f19783cf8acf93d63a9f287fe3a0a51b400363a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Jun 2025 01:58:20 +0000 Subject: [PATCH 1/2] Initial plan for issue From 3f955af8a14728850ea723335e4dfcad6094bb90 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 9 Jun 2025 02:03:22 +0000 Subject: [PATCH 2/2] Improve documentation/comments for game manager interface Co-authored-by: saebyn <185030+saebyn@users.noreply.github.com> --- scripts/gamemanager.gd | 8 +++++--- scripts/main.gd | 2 +- test/unit/test_game_manager.gd | 10 +++++----- test/unit/test_integration.gd | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/scripts/gamemanager.gd b/scripts/gamemanager.gd index fc76029..ad05c6d 100644 --- a/scripts/gamemanager.gd +++ b/scripts/gamemanager.gd @@ -14,10 +14,12 @@ class Score extends Resource: @export var high_scores: Array[Score] = [] -func reset_game() -> void: - # Reset game state - placeholder for actual game logic +func setup_game() -> void: + # Sets up initial game state when starting a new game + # Called when the player starts the game from the main menu pass func restart_level() -> void: - # Restart current level - placeholder for actual game logic + # Restarts the current level from the beginning + # Called when restarting from the pause menu pass \ No newline at end of file diff --git a/scripts/main.gd b/scripts/main.gd index 582a44c..cc8ccf6 100644 --- a/scripts/main.gd +++ b/scripts/main.gd @@ -83,7 +83,7 @@ func _on_game_menu_start_game() -> void: # start the music music_player.play() - GameManager.reset_game() + GameManager.setup_game() func _on_game_menu_restart_game() -> void: diff --git a/test/unit/test_game_manager.gd b/test/unit/test_game_manager.gd index b81a683..680db3c 100644 --- a/test/unit/test_game_manager.gd +++ b/test/unit/test_game_manager.gd @@ -22,12 +22,12 @@ func test_game_manager_has_high_scores_array(): var has_high_scores = "high_scores" in game_manager assert_true(has_high_scores, "GameManager should have high_scores property") -func test_game_manager_reset_game(): - # Test that reset_game method exists and can be called - assert_true(game_manager.has_method("reset_game"), "GameManager should have reset_game method") +func test_game_manager_setup_game(): + # Test that setup_game method exists and can be called + assert_true(game_manager.has_method("setup_game"), "GameManager should have setup_game method") # Should not throw error when called - game_manager.reset_game() - pass_test("reset_game method executed without error") + game_manager.setup_game() + pass_test("setup_game method executed without error") func test_game_manager_restart_level(): # Test that restart_level method exists and can be called diff --git a/test/unit/test_integration.gd b/test/unit/test_integration.gd index 87b3d7f..e393ca9 100644 --- a/test/unit/test_integration.gd +++ b/test/unit/test_integration.gd @@ -43,7 +43,7 @@ func test_autoload_initialization(): assert_not_null(MixerPersistence, "MixerPersistence autoload should be initialized") # Test that they have expected properties/methods - assert_true(GameManager.has_method("reset_game"), "GameManager should have reset_game method") + assert_true(GameManager.has_method("setup_game"), "GameManager should have setup_game method") assert_true(GameManager.has_signal("game_over"), "GameManager should have game_over signal") func test_menu_instantiation_with_signals():