Making games

Particles

A Particle Emitter throws out small sprites that move, grow or shrink, change color and die: smoke, sparks, dust, rain, magic. Scene → Particles creates one already playing, and it plays in the editor too, so you can tune it while you watch.

Emission

PropertyWhat it does
PlayingEmitting at all. Turned off, nothing new appears and what’s alive finishes its life.
RateParticles per second.
BurstParticles thrown out at once when it starts.
Looping, DurationEmit forever, or for Duration seconds and stop.
Max particlesThe most alive at once. Emission waits for room rather than replacing old ones.
ShapeWhere they come from: a Point, a Sphere of Radius, or a Cone (up, spreading by Angle).
SpaceWorld leaves particles behind as the emitter moves, like a trail; Local carries them along, like a flame on a torch.

Each particle

Lifetime, speed and size are each two numbers: a particle picks a value at random between them.

PropertyWhat it does
LifetimeSeconds it lives.
SpeedUnits per second it leaves at.
Size, Size at deathIts size when born, and its size when it dies as a multiple of that (0 shrinks to nothing, 2 doubles).
Color, Color at deathBlended across its life. Fade Color at death’s alpha to 0 for smoke that thins out.
Gravity0 floats, 1 falls like a stone, negative rises (smoke, bubbles).
DragHow fast it slows down.
TextureThe sprite. Empty is a soft round dot.
BlendAlpha for smoke and dust, Additive for fire, sparks and magic, which brighten what’s behind them.
Seed0 is different every time; any other number plays out the same way every time.

From a script

fn on_collision(other, normal) {
    // A puff of sparks from an emitter that's otherwise off.
    self.get_component("ParticleEmitter").emit(20)
}

An emitter’s emit(count) throws out particles at once, whether it is playing or not. play() starts it emitting (a non-looping one starts its duration and burst over), stop() stops it while what is alive finishes, and clear() removes every live particle. They take effect on the next frame, like every change a script makes. See Component actions.