Core guide

Game lifecycle

Start, pause, resume, suspend, and dispose an isolated game instance.

Live example

See Game lifecycle in action

Watch a game-owned object advance while the game loop is running.

live rendering loading ticks 0

How it works

Renderer creation and setup must finish before the frame loop starts. Disposal is idempotent: it aborts setup, cleans late resources, and never revives the game.

Public types

  • Game
  • GameOptions
  • GameSetupContext
  • GameInitializationError
  • GameDisposedError

Minimum viable example

const game = create_game({ renderer, scheduler, setup, update, draw });
await game.ready;
game.pause();
game.resume();
await game.dispose();

Scope and limitations

Scene composition and input routing are separate Phase 3 capabilities. Storage lifecycle remains outside this guide.