Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

MountedScene

A scene’s component mounted headless: the game the devtools attach to, and what unmounts the scene, destroying its entities. The caller destroys the world. Here rather than beside the mount, so a room that steps one needs the core alone.

Property Type Description
input StepInput What every step reads, which holdInput writes.
onFailure? (listener) => () => void Calls listener with what the scene throws after the mount, which empties it, such as a refusal a later update meets; returns what stops it. A room fails on it, as on a reload that throws. mountHeadlessScene gives one; a test’s stand-in may leave it out.
reload? () => Promise<void> Mounts the scene again, so its entities spawn anew, and resolves once every render and effect of the mount has settled: a room calls it in the step a restart raised the world’s SceneReloadsTrait, and steps no more until it resolves. Rejects with what the scene throws as it mounts. mountHeadlessScene gives one; a test’s stand-in for a mount may leave it out.
unmount () => Promise<void> -
world World The world it made, with the map’s ground and the scene’s entities. Step it with stepSeconds(game, seconds) or through the devtools store, and destroy it with world.destroy() once done.