Accessor for the current scene based on the game state. This allows easy access to the current scene without needing to check the state manually.
The current scene based on the game state.
StaticInstanceSingleton instance accessor of the Game class. This ensures that only one instance of the Game class is created throughout the application.
The singleton instance of the Game class.
StaticurlOptionalscore: numberSwitches to the intro scene of the game. This method initializes the intro scene and waits for it to be ready before switching the state.
The Game class is the main entry point for the game. It initializes the game engine, creates the canvas, and manages the game states. It also handles switching between different scenes such as the main menu, cutscene, level, and game over. It is a singleton class, meaning only one instance of it can exist at a time. The singleton instance can be accessed via
Game.Instanceand is created whenDOMContentLoadevent fires.