Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions scripts/gamemanager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion scripts/main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions test/unit/test_game_manager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/unit/test_integration.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down