Skip to content

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

apps/client/src/renderer/gunfire ​

Gunfire as the player sees it: the shots, hits and blasts of the snapshots and the player's own trigger, turned into effects (effects.ts). A shot's tracer leaves the muzzle of the gun in the shooter's hand (muzzleOf: the tip of the fist that holds the barrel's end, as the figure is posed this frame, models.ts, and the gun's length on toward the impact; from a car, the window the shot leaves by, windowOf) and flies to where the shot stopped, one streak per pellet; a muzzle flash at the muzzle; sparks where it struck a wall, a puff of dust off loose ground. A hit on a car throws sparks; a hit on a person bleeds along the shot that made it (the snapshot's shot whose line passes nearest the wound), the burst following the person (blood.ts). Who fired another's shot is read off the snapshots (remotes.ts's shooter); the player's own shots are drawn at the trigger, at once, from the local world. Nothing here changes what a shot did: that is the server's.

Interfaces ​

Type Aliases ​

Variables ​

Functions ​