Skip to content

1681-engine / index / Footsteps

Class: Footsteps ​

Defined in: src/audio/Footsteps.ts:26

Footsteps by the ground under the feet. The game says what a point is made of (surfaceAt: a tile's surface, a Tiled property, a floor collider), and calls step on each beat of a walk or a gait; the sound is the surface's, through sound at the feet, quieter and muffled with distance like every other sound, and dropped first when too many sounds play at once.

Constructors ​

Constructor ​

ts
new Footsteps(options): Footsteps;

Defined in: src/audio/Footsteps.ts:29

Parameters ​

ParameterType
optionsFootstepOptions

Returns ​

Footsteps

Methods ​

setSurfaceAt() ​

ts
setSurfaceAt(surfaceAt): void;

Defined in: src/audio/Footsteps.ts:32

Where the surface of a world point comes from; undefined is the fallback surface.

Parameters ​

ParameterType
surfaceAt(x, y) => string | undefined

Returns ​

void


step() ​

ts
step(
   x, 
   y, 
   local, 
   mounted?
): void;

Defined in: src/audio/Footsteps.ts:42

One step (or a beat of hooves when mounted) at the feet, world x/y; local is the player's own.

Parameters ​

ParameterTypeDefault value
xnumberundefined
ynumberundefined
localbooleanundefined
mountedbooleanfalse

Returns ​

void


surface() ​

ts
surface(x, y): string;

Defined in: src/audio/Footsteps.ts:37

The surface at a world point.

Parameters ​

ParameterType
xnumber
ynumber

Returns ​

string

Released under the MIT License.