Physics · class
StallEscape
Explained in Your first game, Rigid bodies.
class StallEscapeimport { StallEscape } from '@driftengine/physics';Constructor
new
constructor(options?: StallEscapeOptions)| Parameter | Type | Description |
|---|---|---|
options? | StallEscapeOptions |
Properties
| Name | Type | Description |
|---|---|---|
axis | Axis | Which axis the last push took, and which way along it. Read after ESCAPE_PUSHED. |
sign | number |
Methods
reset
reset(): voidBack to watching, for a respawn or a restart.
step
step(body: Body, colliders: ColliderSet, input: StallInput, veto?: EscapeVeto): EscapeResultWatch this tick, and act where the body has genuinely stopped getting anywhere.
| Parameter | Type | Description |
|---|---|---|
body | Body | |
colliders | ColliderSet | |
input | StallInput | |
veto? | EscapeVeto |
More
Call it last in a tick, after the move has been resolved: it reads where the body ended up.