@kayelaa/canvas API - v0.2.15
    Preparing search index...

    Function createGame

    • Creates a new game instance that coordinates scenes, renderers, and a shared ticker.

      The game manages the global update loop (via updateHz) and allows attaching multiple renderers and scenes. Start the game with game.start() to begin ticking and rendering.

      Parameters

      • config: { width: number; height: number; updateHz?: number | "frames" }

        Configuration options

        • width: number

          Logical viewport width (used for entity coordinates)

        • height: number

          Logical viewport height

        • OptionalupdateHz?: number | "frames"

          Tick frequency:

          • "frames" = run updates every render frame (RAF-synced, variable timestep)
          • number = fixed timestep in Hz (e.g. 60)

      Returns KaylaInternals.KaylaGame

      A KaylaGame instance

      const game = createGame({ width: 800, height: 600, updateHz: 60 });
      game.start();