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

definePhysics

definePhysics(options): PhysicsSettings

Declares a game’s physics scene: its gravity, its solver’s passes and the height below which a falling body or character is out of the world. Give it to defineGame as physics in src/game.ts: a page and its room compare it at the welcome. Each setting left out takes its default, and a game that declares nothing steps with every default. Throws on a setting no scene can step with, naming it.

Parameter Type
options PhysicsOptions

PhysicsSettings

export const physics = definePhysics({ gravity: [0, -20, 0] });