Skip to content

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

apps/client/src/renderer/blood ​

Blood as data, drawn as games draw a bullet striking a person: a short burst of red mist along the shot (out of the exit wound, a little back out of the entry), a few drops that fall, and small stains where they land, which fade after a while.

The burst lives in the person's own frame (Spray): each particle is kept as an offset from where the person is drawn, turned with the person's heading, and placed again every frame where the person now is: the emitter is parented to the body, as engines do it, so the burst stays on a person who runs on. Once the person is no longer drawn (gone off screen, removed) it carries on in the world from where it was. The drops (Drops) leave the body: they fly on their own, carrying the person's velocity (as anything thrown from a moving body does), fall, and leave a stain where they meet the ground (marks.ts's quads). effects.ts draws them; nothing here touches the simulation.

Classes ​

Interfaces ​

Type Aliases ​