Add toggle menu item to main menu and menu system#81
Merged
colinkiama merged 5 commits intomainfrom Mar 17, 2025
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request includes several updates to the game's scene management and event handling, as well as some refactoring to improve code maintainability. The most important changes include adding a new pause event, updating high score retrieval and storage, and refactoring interactive elements in various scenes.
Event Handling Improvements:
PAUSE_REQUESTEDevent toCrossSceneEventinsrc/constants/events.jsto handle pause requests across scenes.Battlescene to handlePAUSE_REQUESTEDevent and launch the pause menu with an additional parameter. [1] [2] [3]HUDscene to emitPAUSE_REQUESTEDevent instead of directly launching the pause menu.High Score Management:
this.registryinstead ofthis.game.registryinBattle,HUD, andPreloaderscenes for consistency. [1] [2] [3] [4]Interactive Elements Refactoring:
ControlsandCreditsscenes to store interactive items and properly clean up event listeners on shutdown. [1] [2] [3] [4]onBackButtonPressForInstanceandonButtonPressForInstancefunctions to handle button presses in a more modular way. [1] [2]Menu System Enhancements:
MainMenuandPauseMenuscenes to dynamically update sound toggle labels based on the current sound state and handle data changes for sound preferences. [1] [2] [3] [4]Code Cleanup:
WEBSITE_URLimport fromControls,Credits, andMainMenuscenes. [1] [2] [3]_tweenTimelineproperty fromGameOverscene.Fixes #60