Expand description
Fixed-size particle pool. Covers the “explosion burst” case 99% of arcade games want:
- Spawn N coloured particles at a point, each with a random velocity spread.
- Each frame: integrate position + velocity, apply gravity, decrement TTL.
- Render as
RectFlats into an ordering table, with colour and size tapering as TTL approaches zero.
Const-generic pool size – each consumer picks what fits its scene budget:
ⓘ
static mut PARTICLES: ParticlePool<48> = ParticlePool::new();Values beyond what you pass in on spawn are 0-initialised;
ttl == 0 marks a slot as empty. No allocation, ever.
Structs§
- Particle
- One live particle.
- Particle
Pool - Fixed-capacity pool of
Nparticles.