@ujjwalvivek/tinyts
    Preparing search index...

    Class Engine

    Core game engine - owns the main loop, renderer, input, audio, and subsystems.

    const engine = engineStart({ size: { width: 320, height: 240 }, update: (dt) => {}, render: (alpha) => {} });
    
    Index

    Constructors

    Properties

    alpha: number = 0

    Interpolation alpha between the last two fixed updates (0-1).

    audioManager: AudioManager
    canvasManager: CanvasManager
    config: EngineConfig
    frameCount: number = 0

    Total number of fixed-update steps executed.

    inputManager: InputManager
    particleSystem: ParticleSystem
    rafId: number = 0

    Current requestAnimationFrame ID.

    renderer: Renderer
    running: boolean = false

    Whether the engine loop is active.

    stats: EngineStats = ...

    Live performance statistics, updated each frame.

    time: number = 0

    Total elapsed simulation time in seconds.

    tweenManager: TweenManager

    Methods

    • Stop the engine loop and release all resources.

      Returns void