AbstractCanvas registry + 2D context exposure. Register canvases here from the constructor (canman.setupCanvas(CANVAS_TYPES.MAIN, "#game")) before calling preInit.
The fixed-step driver. Started automatically by preInit when Settings.autoloop is true.
Live keyboard state. See Keyboard.
Live pointer (mouse / pen / touch) state. See Pointer.
Render the current frame. Called by Gameloop after the canvas is cleared. Subclasses must override — the default throws.
ProtectedpreFinalise engine wiring and start the loop. Call once from the subclass constructor after registering canvases. Steps: canman.finishSetup() → install debounced window.resize → reset gameloop.levelTime → await this.init() (if doInit) → dispatch "resized" → start the loop if Settings.autoloop. Throws if called twice. Pass doInit: false to skip the init() await (useful for tests).
Advance the simulation by dt seconds (= Settings.fps). Called by Gameloop zero-or-more times per frame depending on real-time accumulation. Subclasses must override — the default throws.
Abstract base for a Gleam game. Subclass it and implement init, update, and draw. The constructor wires up CanvasManager, Gameloop, Keyboard, and Pointer; the subclass must register at least one canvas with
canman.setupCanvas(...)and then call preInit to start everything.Singleton-per-page. The framework registers global listeners on
window/documentand writeshistory.scrollRestoration; multiple instances on the same page will fight each other.