Physics · class

StallEscape

Explained in Your first game, Rigid bodies.

class StallEscape
import { StallEscape } from '@driftengine/physics';

Constructor

new

constructor(options?: StallEscapeOptions)
ParameterTypeDescription
options?StallEscapeOptions

Properties

NameTypeDescription
axisAxisWhich axis the last push took, and which way along it. Read after ESCAPE_PUSHED.
signnumber

Methods

reset

reset(): void

Back to watching, for a respawn or a restart.

step

step(body: Body, colliders: ColliderSet, input: StallInput, veto?: EscapeVeto): EscapeResult

Watch this tick, and act where the body has genuinely stopped getting anywhere.

ParameterTypeDescription
bodyBody
collidersColliderSet
inputStallInput
veto?EscapeVeto
More

Call it last in a tick, after the move has been resolved: it reads where the body ended up.