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

buildingSaves

const buildingSaves: object

The kit’s world saves, which a game lists so its pieces and areas outlive a restart: defineGame({ worldSaves: { ...buildingSaves } }). A world whose room holds it and lists none refuses every placement, so no player pays for a piece a restart would lose.

Name Type Description
buildAreas EachSaveDeclaration<Trait<() => BuildAreaRecord>> Each area’s record. Every page holds every area, as spawnBuildArea gave it.
pieces EachSaveDeclaration<NumberTypedTrait<Trait<{ isStored: boolean; piece: string; placedBy: string; quarterTurns: number; storedBy: string; variant: string; x: number; y: number; z: number; }>, { quarterTurns: "uint8"; x: "int32"; y: "int32"; z: "int32"; }>> Each piece’s record: its name, its cell, its turn, its variant, who placed it, and whether and where it is stored. A stored piece’s colliders and reach come back as storing it set them.