Kerby64
    Preparing search index...

    Generic game level scene class.
    This class is used to set up the game level itself, load the environment, and manage the player.
    It extends the Scene class from Babylon.js and uses the WebGPUEngine for rendering.
    It also display a score for the game. (to display a score on the gameover screen)

    Hierarchy

    • Scene
      • LevelScene
    Index

    Constructors

    Properties

    environment?: Environment
    score: number = 0
    scoreText: TextBlock

    Methods

    • Load a basic GUI for the game.
      This method creates a fullscreen UI and adds the score text block to it.\

      Returns Promise<void>

    • Set up the level scene with the specified game type and classic level.
      This method loads the environment based on the game type and classic level, load the player mesh, and adds the appropriate controller.
      It also sets up shadows and registers a before render update for the environment.

      Parameters

      • gameToLoad: string | number

        The game type to load (e.g., rush, bird, world, classic).

      • OptionalclassicLevel: string | number

        The classic level to load (if applicable).

      • Optional_seed: number

        The seed for the game (optional).

      Returns Promise<void>

    • Update the navigator history with the current game state.
      This method updates the URL with the current game state, including the game type and seed if applicable. This is useful for bookmarking or sharing the current game state.
      This methos do not reload the page, it just updates the URL.\

      Parameters

      • Optionaldata: { [key: string]: string }

      Returns void

    • Update the score of the game.\

      Parameters

      • value: number

        the value to add to the current score.

      Returns void