Kerby64
    Preparing search index...

    Class Game

    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.Instance and is created when DOMContentLoad event fires.

    Index

    Constructors

    Properties

    canvas: HTMLCanvasElement
    engine: WebGPUEngine

    Accessors

    • get Instance(): Game

      Singleton instance accessor of the Game class. This ensures that only one instance of the Game class is created throughout the application.

      Returns Game

      The singleton instance of the Game class.

    • get urlParams(): URLSearchParams

      Returns URLSearchParams

    Methods

    • Parameters

      • levelToLoad: string | number
      • OptionalclassicLevel: string | number
      • Optionalseed: number

      Returns Promise<void>

    • Parameters

      • Optionalscore: number

      Returns Promise<void>

    • Switches to the intro scene of the game. This method initializes the intro scene and waits for it to be ready before switching the state.

      Returns Promise<void>

    • Returns Promise<void>

    • Returns Promise<void>