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

readFlight

readFlight(step, ball): Readonly<FlightState> | null

Where ball’s flight is at the step’s tick, or, outside a step, at tick: its position, velocity, the tick it landed and whether it is held, written in place, so read it at once. Null for an entity whose body has no flight. Exact on the room and every page, a re-run included.

Parameter Type
step SystemStep
ball Entity

Readonly<FlightState> | null

const { position, landedTick } = readFlight(step, ball) ?? {};

readFlight(world, ball, options): Readonly<FlightState> | null

Where ball’s flight is at the step’s tick, or, outside a step, at tick: its position, velocity, the tick it landed and whether it is held, written in place, so read it at once. Null for an entity whose body has no flight. Exact on the room and every page, a re-run included.

Parameter Type
world World
ball Entity
options { tick: number; }
options.tick number

Readonly<FlightState> | null

const { position, landedTick } = readFlight(step, ball) ?? {};