Particles — emitters of transient targets
particlessprays many short-lived targets — sparks, smoke, rain, an explosion — each a tiny target that moves, fades, and dies. Emitters run in the stage's Advance phase, draw their variety from the seeded PRNG, and recycle particles throughspawnso a fountain never churns allocation. Varied on screen, identical on replay.
Status: design. Not built yet.
What it is
An emitter is a source with a rule: a rate (or a burst), a per-particle lifetime, a spawn area, an initial velocity with spread, and a fate — usually a tween of alpha / size / colour over each particle's life, and a drift or gravity force. Each particle is an ordinary target that lives briefly and despawns; an emitter just makes and kills a lot of them, every tick.
Seeded variety — why it needed the PRNG
The spread, jitter, and lifetimes that make an emitter look alive come from the stage's seeded random, never math.random. So a fountain looks convincingly varied and replays exactly — the reason particles waited for the PRNG. Two runs from the same seed spray identically, spark for spark.
Pooled by construction
A heavy effect can be thousands of particles a second; allocating each would churn. Emitters draw from a spawn pool — a particle is a recycled target — so the registry stays bounded and the frame stays allocation-free.
On the stage
particles runs in Advance: each tick an emitter spawns new particles (from its pool, using the seeded PRNG), advances live ones (their motion + tween), and despawns the expired — drawn through either the FireStorm hardware chipset or the always-available software chipset (a particle layer over any retro system). It reads its emitter rules, writes many transient targets, references no other system, and inherits the determinism contract.
Clients
- Luau —
require("particles"): make emitters, burst, stop. - AntBASIC — an
EMITverb for a one-line burst (EMIT "spark", x, y) over a named preset.
Related
- spawn — the pool it recycles through · stage — the tick + seeded PRNG · tween / physics — per-particle fade and drift
- luau_particles — the Luau API