Repository navigation
Pause Menu
This Godot 4 script represents the pause menu scene for a game. It extends the Control class and provides functionality for handling user interactions within the pause menu. The menu includes options for resuming the game, returning to the main menu, and quitting the game.
game_manager
Type: NewGame
Description: Reference to the NewGame class used in the project.
_ready()
Description: Called when the node enters the scene tree for the first time. Hides the pause menu, connects to the game manager's "toggle_game_paused" signal, and sets focus on the resume button for user interaction.
_process(delta)
Parameters:
delta: Elapsed time since the previous frame. Description: Called every frame. No processing is currently implemented in this method.
_on_final_game_toggle_game_paused(is_paused: bool)
Parameters:
is_paused: bool - The state of the game pause.
Description: Handler for the game manager's "toggle_game_paused" signal. Shows or hides the pause menu based on the game's pause state.
_on_resume_pressed()
Description: Handler for the resume button pressed. Sets the game's paused state to false and sets focus on the resume button.
_on_quit_pressed()
Description: Handler for the quit button pressed. Exits the game.
_on_main_menu_pressed()
Description: Handler for the main menu button pressed. Changes the scene to the main menu and frees the current scene instance.