Skip to main content
← PSoXide SDK guides and examples · SDK f2fec1c301f1 · All Cargo features enabled; check feature gates before use.

Module particles

Module particles 

Source
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.
ParticlePool
Fixed-capacity pool of N particles.