Initial state.
Action map. Use defineActions for the best inference.
OptionalupdatePer-frame update hook. Receives current state, frame dt (seconds), and
the dispatcher so you can call actions from here.
OptionalrenderPer-frame render hook. Receives state and alpha (interpolation factor
if fixedStep is set, else 0).
OptionalfixedSeconds per fixed tick (e.g. 1/60). Omit for a variable-step loop.
OptionalfixedFixed-step physics hook. Use when fixedStep is set.
OptionalmaxCap on dt per frame (seconds). Default 0.25.
OptionalkeyboardWhether to instantiate a Keyboard. Defaults true in browsers.
OptionalpointerWhether to instantiate a Pointer. Defaults true in browsers.
OptionalgamepadWhether to instantiate a Gamepad. Defaults true in browsers.
When enabled, the gamepad is polled automatically at the start of every
update tick — game.gamepad.isDown('A') inside your update hook reads
fresh state from the platform.
OptionaldevWhen true, every state value is Object.freezed. Use in dev only.
OptionalschedulerCustom scheduler (tests, headless Node loop, etc.).
OptionalseedSeed for game.random, the built-in seeded RNG.
Pass a value for reproducible runs; omit for an auto-seeded generator
(read game.random.seed to recover it).
OptionaltimersWhether to instantiate game.timers and auto-advance it at the top of
every update tick. Default true. Set false to opt out of the
per-tick advance (the pool is still created so game.timers is defined).
OptionaltapFires synchronously after every dispatched action's setState succeeds,
with the action name and its arguments. Hook a
recorder, logger, or analytics sink here.
Firing after setState (rather than before) is deliberate: it keeps the recorded event order identical to the apply order even when the tap itself dispatches further actions, and skips events for actions that threw — so recordings remain deterministically replayable.
Configuration for createGame. See the property docs for a full tour; the only required fields are
stateandactions.