What it does
An emitter is an object in your game world, with a position, a layer and a depth. It can follow another object at an offset, and its particles are drawn in its place in the sort order, batched with their neighbours: a thruster's flame behind the ship, sparks in front of it, snow at the very back. It belongs to the scene that made it, so it is tidied away when the scene ends.
Every value in an emitter's config is an op: a plain number, a random range, a value eased over the particle's life, a keyed curve, a step per emission, or a callback for the rare effect that is not data. Speed, angle, size, scale, alpha, rotation and colour can all change over a particle's life, and colours are any CSS colour, as a single colour, a ramp over life or a random palette.
For the commonest job, a burst on every hit or explosion, game.particles.burst throws a one-shot spray in a cone
from a point and keeps one pooled emitter per recipe, so a busy game makes no new objects for its effects. Ready-made
effects, several emitters on a timeline, come as data from the vfx packs or your own definitions, and a finished
effect is kept to play again rather than rebuilt.
Features
- Emitters as game objects — position, layer, depth,
followwith an offset, and scene ownership, sorted and batched with the sprites around them. - Ops for every value — constants, random ranges, curves over life, keyed curves with easing, steps per emission and callbacks.
- One-shot bursts —
game.particles.burstaims a spray with an angle and a spread on a pooled emitter per recipe, with sensible defaults, so a burst on every hit costs nothing extra. - Effects on a timeline — several emitters started together, scaled and rotated as one, by name; finished effects are pooled and replayed.
- Zones — particles born in or along any shape (lines, circles, rings, arcs, polygons, splines, paths) and killed on entering or leaving another.
- Forces — wells, attractors, vortices, orbits, wind and curl noise, plus gravity, drag and speed limits.
- Collision with your level — particles bounce off, slide along or die on any solid you can test a point against, such as a tilemap or a heightfield.
- Sub-emitters — particles that spawn particles on birth, death or at intervals, inheriting velocity and colour.
- Rate over distance — a moving emitter lays particles along its path, for dust behind wheels and smoke behind missiles.
- Ribbon trails —
game.particles.traildraws a continuous tapering ribbon behind a moving object. - Deterministic and headless — seeded, so effects replay identically, and testable without a screen.
Good for
- Shooters and action games — muzzle flashes, impacts, explosions, engine flames and debris on every hit.
- Platformers — dust from landings, sparkles from pickups, rain and snow in the background.
- Puzzle games — bursts and confetti when tiles clear, sized and coloured per tile.
- Top-down games — smoke and dust that collide with walls, and footprints of particles behind characters.
- Magic and RPG effects — orbiting motes, vortices, glows and trails behind spells.
- Atmosphere — embers rising from a fire, fireflies, falling leaves and drifting fog.
Make it yours
Every emitter is a config, and every config value can vary, so the same pack makes a gentle snowfall and a violent explosion. Effects scale and rotate as a whole, so one explosion serves a grenade and a building. You can register your own effects as data beside the ones the vfx packs bring, retune one by copying its definition under a new name, and decide how many finished effects are kept for reuse, or none.
Two very different uses: a looping campfire that follows a torch-bearer, its flames rising in a ramp from yellow to red with embers spawned from each dying flame; and a burst of tile-coloured confetti, aimed upward in a narrow cone, every time a puzzle row clears.
A quick look
A flame that follows a ship, and a pooled burst of debris on every hit:
game.particles.emitter({
follow: ship, offset: { x: -18, y: 0 }, frame: 'particle:soft', blend: 'add',
rate: 120, lifespan: [0.3, 0.6], speed: [60, 120], angle: [160, 200],
scale: { start: 0.5, end: 0, ease: 'easeOutQuad' }, color: ['#fff7e0', '#ff8c00', '#5c0a00'],
});
game.particles.burst({ x: hit.x, y: hit.y, count: 16, angle: shotAngle + 180, spread: 70,
frame: 'particle:spark', speed: [80, 200], gravityY: 300 });
Works with
particle-textures— soft, disc, star, spark, smoke and other particle pictures that need no image files.vfx-explosion,vfx-fire,vfx-smoke,vfx-sparks,vfx-magic,vfx-weather,vfx-party,vfx-water,vfx-lightning— ready-made effects by name.core-2d— includes this pack, so most 2D games have it already.particles-gpu— for fields beyond about twenty thousand particles, simulated on the GPU.particles-3d— the same ideas for 3D worlds.
Good to know
- It simulates on the CPU and is comfortable to about twenty thousand live particles a scene;
particles-gpugoes far beyond that. - Collision is a point test, so a particle moving further in one step than a wall is thick can pass through it.
- One blend mode per emitter: a mix of additive and normal particles needs two emitters.
- Angles are in degrees, and sizes are full sizes rather than radii.






