five-on-it / apps/client/src/renderer/blood / Spray
Class: Spray
Defined in: apps/client/src/renderer/blood.ts:75
The bursts of mist, each following the person it came from.
Constructors
Constructor
new Spray(
capacity,motion):Spray
Defined in: apps/client/src/renderer/blood.ts:86
At most capacity particles at once, moving as motion says in their anchor's frame.
Parameters
capacity
number
motion
Returns
Spray
Properties
items
readonlyitems:SprayParticle[] =[]
Defined in: apps/client/src/renderer/blood.ts:77
The live particles, oldest first.
spawned
spawned:
number=0
Defined in: apps/client/src/renderer/blood.ts:79
Particles spawned since the start.
Methods
begin()
begin(
anchor,at):number
Defined in: apps/client/src/renderer/blood.ts:95
Starts a burst on anchor (a server entity id), drawn now as at says, or in the world (at undefined); returns its number, which its particles are spawned with.
Parameters
anchor
number
at
Anchor | undefined
Returns
number
spawn()
spawn(
anchor,at,burst,p):void
Defined in: apps/client/src/renderer/blood.ts:110
Adds a particle of the burst burst at a world point with a world velocity (p), kept in the frame of anchor as at stands now (none: in the world). Past the cap, the oldest gives way.
Parameters
anchor
number
at
Anchor | undefined
burst
number
p
Omit<Particle, "age">
Returns
void
step()
step(
dt,locate):void
Defined in: apps/client/src/renderer/blood.ts:139
Moves and ages every particle by dt seconds in its anchor's frame, then places it where its anchor is drawn now (locate); a particle whose anchor is no longer drawn carries on in the world from where it was. Drops the ones whose life is over.
Parameters
dt
number
locate
Returns
void
views()
views():
BurstView[]
Defined in: apps/client/src/renderer/blood.ts:166
The bursts remembered, oldest first (see BurstView).