Skip to content

five-on-it / apps/client/src/renderer/blood / Drops

Class: Drops ​

Defined in: apps/client/src/renderer/blood.ts:210

The drops of blood in the air.

Constructors ​

Constructor ​

new Drops(capacity, motion): Drops

Defined in: apps/client/src/renderer/blood.ts:220

At most capacity drops at once, moving as motion says.

Parameters ​

capacity ​

number

motion ​

ParticleMotion

Returns ​

Drops

Properties ​

items ​

readonly items: Drop[] = []

Defined in: apps/client/src/renderer/blood.ts:212

The drops in the air, oldest first.


landed ​

landed: number = 0

Defined in: apps/client/src/renderer/blood.ts:215


spawned ​

spawned: number = 0

Defined in: apps/client/src/renderer/blood.ts:214

Drops thrown since the start, and those that landed.

Methods ​

spawn() ​

spawn(p): void

Defined in: apps/client/src/renderer/blood.ts:226

Throws a drop (its age starts at 0); past the cap, the oldest gives way.

Parameters ​

p ​

Omit<Drop, "age">

Returns ​

void


step() ​

step(dt, land): void

Defined in: apps/client/src/renderer/blood.ts:236

Moves and ages every drop by dt seconds; one that reaches its floor lands there (land is told where, and how big the drop is) and is gone, as is one whose life is over.

Parameters ​

dt ​

number

land ​

(x, y, z, size) => void

Returns ​

void