frostHazards.sounds: every hazard kind makes its sound, heard in 3D by every player near
it. Each machine works out the same moments from the shared clock (a snowball starts
rolling, an icicle cracks and shatters, a gust swells, a vent rumbles and bursts, an
avalanche roars, rocks clatter, thin ice cracks and breaks, spikes shoot up) and plays
them at the right place through the engine's spatial Audio, so nothing is sent over the
net. Looks shift the pitch (an ice boulder rolls lower, crystal icicles ring higher).
avalanche_rumble( ) → void
rockfall_clatter( ) → void
frostspike_shoot( ) → void
setEnabled(on: boolean) → void
Turn every hazard sound on or off.
| arg | type | description |
|---|
| on | boolean | |
setVolume(v: number) → void
Overall volume of the hazard sounds, 0..1.
| arg | type | description |
|---|
| v | number | |
setChannel(ch: string) → void
The engine mixer channel hazard sounds play on (default "sfx").
| arg | type | description |
|---|
| ch | string | |
enabled( ) → boolean return cfgState
clip(name: string) → any
| arg | type | description |
|---|
| name | string | |
missing( ) → void
Resolve every clip; returns the names that did not resolve (for tests).
qrot(q: any, x: number, y: number, z: number) → void
| arg | type | description |
|---|
| q | any | |
| x | number | |
| y | number | |
| z | number | |
emitter(owner: any) → any
A sound emitter for one hazard entity. Call em:step(cfg, t, iceState?) each play frame,
em:stop() when the hazard pauses, em:destroy() when it goes.
| arg | type | description |
|---|
| owner | any | |
world(lx: number, ly: number, lz: number) → vector
| arg | type | description |
|---|
| lx | number | |
| ly | number | |
| lz | number | |
voice(key: string, cue: any, pitch: number, at: vector) → void
a voice is spawned sounding (autoplay) the first time it is needed: a play() in the
frame its source is still being installed is lost, so only later plays go through play()
| arg | type | description |
|---|
| key | string | |
| cue | any | |
| pitch | number | |
| at | vector | |
play(cfg: any, name: string, lx: number, ly: number, lz: number, slot: number?) → void
Play cue `name` of `cfg.kind` at a local point (x, y, z in the hazard's frame).
| arg | type | description |
|---|
| cfg | any | |
| name | string | |
| lx | number | |
| ly | number | |
| lz | number | |
| slot | number? | |
hold(cfg: any, name: string, on: boolean, lx: number?, ly: number?, lz: number?) → void
Keep looping cue `name` playing at a local point (on = false stops it).
| arg | type | description |
|---|
| cfg | any | |
| name | string | |
| on | boolean | |
| lx | number? | |
| ly | number? | |
| lz | number? | |
stop( ) → void
Stop every looping sound of this hazard.
step(cfg: any, t: number, ice: string?) → void
Work out this frame's moments for the hazard and sound them. `ice` = thin ice state.
| arg | type | description |
|---|
| cfg | any | |
| t | number | |
| ice | string? | |