Protected_ProtectedcolorCSS color string passed to context.fillStyle in draw.
ProtectedlifetimeAccumulated time (seconds) since spawn or last resetLifetime.
ProtectedmaxLifetime cap in seconds, randomized to [0.5, 1.5] at construction.
ProtectedposTop-left position. Cloned from the constructor arg so the caller's Vec2 isn't aliased.
ProtectedsizeCircle radius (pixels).
ProtectedvelVelocity in px/s. Seeded randomly by the constructor (random angle, random magnitude per axis).
false once lifetime reaches maxLifeTime. Owners typically filter dead particles out of their list each frame, or call resetLifetime to recycle.
Recycle a dead particle by subtracting maxLifeTime from lifetime — preserves any overshoot so a pool of pre-allocated particles can stay phase-stable across loops. Note this doesn't re-randomize vel or pos; mutate those externally if you want a fresh trajectory.
Integrate lifetime, position, and bounding rect.
Single particle drawn as a filled circle. The constructor seeds a random velocity (random angle, per-axis speed in
[50, 150]px/s) and a randommaxLifeTimein[0.5, 1.5]s — spawn many at once for spark/dust effects. Each tickupdate(dt)advanceslifetimeandpos; the particle is "dead" when alive flips tofalse.