Constructs a new GameScene.
The Babylon.js engine.
The input handler for this scene.
Protected
activeProtected
camerasProtected
cubeProtected
engineThe Babylon.js engine instance.
Protected
gameProtected
hpProtected
inputHandles user input for the scene.
Protected
levelProtected
multiplicatorsProtected
parentProtected
playerProtected
sceneThe Babylon.js scene instance.
Protected
sceneProtected
scoreProtected
stateProtected
Readonly
timeProtected
timerProtected
Static
sceneProtected
Static
Readonly
sceneProtected
addInitializes Havok physics for the scene with high gravity and a fixed timestep. Should be called asynchronously.
Switches to the next available camera.
Checks if the player has lost (is dead).
True if the player is dead, false otherwise.
Checks if the player has won the level.
True if the player has won, false otherwise.
Loads a level from a file.
The level file to load.
Enables the Babylon.js debug layer for scene inspection.
Returns the current Babylon.js scene.
Returns the current score.
Returns the current timer value.
Indicates if there is a next level (always false in this scene).
False.
Hides the UI elements (e.g., health bar).
Protected
loadLoads the level using the LevelLoader.
The level file to load.
Handles collision with the bottom of the cube (player death).
The PhysicsBody that collided.
Callback for the "continue" action on the end screen HUD.
Callback when the level is fully loaded. Sets up cameras, collisions, timer, HUD, and background music.
Callback when a new game object is created.
The created GameObject.
Callback when the parent node is created.
The created ParentNode.
Callback for the "quit" action on the end screen HUD.
Callback for the "retry" action on the end screen HUD.
Callback when a new object is spawned (e.g., by an enemy).
The spawned GameObject.
Fully resets and reloads the scene (for retry/continue).
Removes physics bodies from all objects and disables the physics engine.
Renders the current state of the scene.
Restarts the scene by disposing and recreating it.
Protected
setupSets up the available cameras for the scene.
Protected
setupSets up collision callbacks for all game objects.
Sets up custom key actions for the scene.
Protected
startStarts the in-game timer and displays the timer UI.
Main update loop for the scene. Handles state transitions.
Delta time since last update.
Updates all game objects and the HUD.
Delta time since last update.
The current input state.
Updates the in-game timer and its display.
Delta time since last update.
Visitor pattern: called when the player collects a coin.
The Coin object.
Visitor pattern: called when the player collides with an enemy.
The Enemy object.
Visitor pattern: called when the player reaches the victory condition.
The VictoryCondition object.
Static
createStatic factory to create and initialize a new GameScene.
The Babylon.js engine.
The input handler.
The created and initialized GameScene.
GameScene manages the main singleplayer gameplay loop in Nocturna.
Responsibilities: