StaticantialiasEnable smoothing on the main canvas context. Default false for crisp pixel art.
StaticautoloopStart the gameloop automatically after init() resolves. Disable to drive gameloop.startLoop() manually. Default true.
StaticbackgroundCSS color used when useClearRect is false. Default "#444".
StaticdebugDebug mode: assigns the Game instance to window.game and lets Keyboard Escape stop the loop. Default false.
StaticdoSkip the per-frame canvas clear. Use for trail/decay effects where you manage clearing yourself. Default false.
StaticenableStretch the main canvas to fill the window on resize while preserving its aspect ratio. Default true.
StaticfontDefault font family for canman.setFontSize. Default "Arial".
StaticfpsSeconds per fixed step, not frames per second — 1 / 60 = 60 Hz, 1 / 30 = 30 Hz. Must be finite and > 0 or init throws.
Static OptionaltriedCallback invoked from the beforeunload handler when warnBeforeClose is true. Useful for "are you sure?" autosave logic.
StaticuseClear the canvas with clearRect (transparent) when true, or fillRect with backgroundColor when false. Default true.
StaticwarnShow a browser "are you sure?" dialog on tab close. Required for triedToClose to fire. Default false.
StaticlocalRead-only view of the persisted localStorage blob. Writes go through setLocalStorage.
StaticinitOne-time setup — called by Game's constructor with the overrides passed to super(). Validates fps, loads the persisted localStorage blob, derives language from navigator.language, and wires the close-warning handler if warnBeforeClose. Throws if called twice or if fps isn't a finite positive number.
Staticset
Engine-wide configuration. A static-class singleton — read/write top-level fields directly (
Settings.fps = 1 / 30). Initialised once via init fromGame's constructor; callinginittwice throws.