phaserjs/phaser/particles
Claude Code and agent skill by phaserjs/phaser
- community
Checking that the SKILL.md file is still in the repository.
Particle effects in Phaser 4: this.add.particles(x, y, texture, config) returns a ParticleEmitter Game Object (no manager). Covers the config value formats (min/max, start/end, steps, onEmit/onUpdate), flow and explode, color and tintMode, emit and death zones, gravity wells and processors, following a target, sorting and the emitter events. Use when making an explosion, sparks, confetti, smoke, fire, rain, a trail behind a ship or player, or a hit effect. Corrects old habits: ParticleEmitterManager and createEmitter are gone, tintFill is now tintMode, explode(count, x, y) and gravity wells are relative to the emitter, onEmit gets only (particle, key). Triggers on: particles, this.add.particles, ParticleEmitter, emitter, explode, burst, particle trail, confetti, emitZone, deathZone, GravityWell.
Install
npx vskill@latest install phaserjs/phaser/particlesSKILL.md
The same SKILL.md was published earlier as phaserjs/phaser/particles.
Particles
Particle effects with the ParticleEmitter Game Object: one texture, one config, and a pool of particles it updates and draws.
Source: src/gameobjects/particles/ParticleEmitter.js (the JSDoc at the top lists every value format), Particle.js, EmitterOp.js, GravityWell.js, ParticleProcessor.js, zones/, events/, typedefs/ParticleEmitterConfig.js. Related: animations, game-object-components, filters-and-postfx, graphics-and-shapes.
Quick start
this.add.particles(x, y, texture, config)returns aParticleEmitter. There is no ParticleEmitterManager and nocreateEmitter: make one emitter per effect.- The emitter is a Game Object:
setDepth,setScrollFactor,setBlendMode,setVisible,destroy, and it can go in a Container or Layer. - With a texture atlas, pick frames with
frame: 'red',frame: [ 'red', 'blue' ](random), orframe: { frames: [ ... ], cycle: true, quantity: 4 }.
Positions are relative to the emitter
Particles are drawn through the emitter's transform, so the emitter's position, scale and rotation apply to every live particle.
explode(count, x, y)andemitParticleAt(x, y, count)take positions relative to the emitter. Keep a burst emitter at (0, 0) and pass world positions, as above.- Moving the emitter moves its live particles with it. A trail should stay where it was left, so keep the emitter at (0, 0) and use
startFollow. - The config
xandy, emit zones and gravity wells are relative to the emitter too. A position given toexplode, or a followed target, replaces the configxandy, unless they are stepped. - Death zones,
boundsandviewBoundsare in world space.
Value formats
Most config keys take any of these. Keys marked "emit" in the table below are only set on emit; the others also change over the particle's life.
An onEmit callback, or a plain function, gets only (particle, key) and must return the value. Old examples wrote (particle, key, t, value) => value, which returns undefined and makes the property NaN. Only onUpdate gets t and the current value.
Config
The full list, with types, is src/gameobjects/particles/typedefs/ParticleEmitterConfig.js.
| Key | Default | Notes | |
|---|---|---|---|
emitting | true | false makes it idle until start() or explode() | |
frequency | 0 | ms between emissions. 0 is every frame; -1 is explode mode | |
quantity | 1 | Particles per emission (emit) | |
lifespan | 1000 | ms (emit) | |
speed | 0 | With angle (emit). speedX and speedY instead set radial: false | |
angle | { min: 0, max: 360 } | Degrees (emit) | |
scale, scaleX, scaleY | 1 | scale sets both | |
alpha | 1 | ||
rotate | 0 | Degrees | |
tint | 0xffffff | WebGL only. Don't use start/end with it: use color | |
color, colorEase | An array of colors the particle moves through over its life. WebGL only | ||
tintMode | Phaser.TintModes.MULTIPLY | Applies to every particle. WebGL only | |
gravityX, gravityY | 0 | Pixels per second per second | |
accelerationX/Y, maxVelocityX/Y, bounce | 0, 10000, 0 | ||
moveToX, moveToY | Set both: each particle travels to that point over its life | ||
delay | 0 | ms a new particle waits, visible and still, before it moves and ages (emit) | |
hold | 0 | ms a particle stays, frozen, after its life ends (emit) | |
maxAliveParticles | 0 | The most alive at once. 0 is no limit | |
maxParticles | 0 | The most it ever creates, alive and dead: once reached it emits no more. Use maxAliveParticles to cap what's on screen | |
duration, stopAfter | 0 | Stop after this many ms, or this many particles | |
advance | 0 | ms to run at once, so the effect is already going on the first frame | |
reserve | Particles to create up front | ||
anim | Animation key(s) each particle plays. See animations | ||
follow, followOffset, trackVisible | See the trail below | ||
blendMode | 0 | Such as 'ADD' |
setConfig(config) replaces the config. updateConfig(config) merges into it, but currently adds the config's emit zones, death zones and bounds a second time (an engine issue). If you will call updateConfig, add those with addEmitZone, addDeathZone and addParticleBounds instead of in the config. There are setters for live changes: setParticleSpeed, setParticleScale, setParticleGravity, setParticleAlpha, setParticleTint, setParticleLifespan, setEmitterAngle, setQuantity, setFrequency, setEmitterFrame, setAnim.
Flow and bursts
COMPLETE fires when the last particle dies, but only once the emitter isn't emitting. An emitter made with the default emitting: true stays emitting after explode(), so make burst emitters with emitting: false.
A one-shot explosion that removes itself:
For explosions that happen often, keep one emitter and call explode each time, rather than making new ones.
Trails and confetti
startFollow(target)emits attarget.x + offsetX,target.y + offsetY, in the emitter's space, so leave the emitter at (0, 0).stopFollow()ends it.trackVisiblehides the emitter when the target is hidden.
Color and tint
tintandcolorare WebGL only. The Canvas renderer draws particles untinted.- For a color change over a particle's life use
color: [ ... ], which blends each channel.tint: { start, end }blends the packed numbers, which gives the wrong colors. tintModereplaced v3'stintFill.tintMode: Phaser.TintModes.FILLmakes each particle a solid shape of its tint. The modes are in game-object-components.
Zones
- A
randomzone needs a source withgetRandomPoint(point): Circle, Ellipse, Rectangle, Triangle, Line, or your own object. A Polygon has nogetRandomPoint, so it is dropped without a warning. - An
edgezone needsgetPoints(quantity, stepRate): any Geom shape, Curve or Path. Its options arequantity,stepRate,yoyo,seamless(defaulttrue) andtotal. - A death zone's source needs
contains(x, y).onEnterkills particles inside it,onLeavekills those outside it. It emitsDEATH_ZONE. - With several emit zones, the emitter moves to the next one after
totalparticles. A random zone'stotalis-1, so with several random zones only the first is used. Settotalon each zone thataddEmitZonereturns:emitter.addEmitZone([ a, b ]).forEach(zone => zone.total = 10). bounds: { x, y, width, height }withbouncekeeps particles in a world-space rectangle.collideLeft,collideRight,collideTopandcollideBottomdefault totrue.
Gravity wells and processors
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/particles/SKILL.md
Popularity
- Repository stars
- 39,633
- Repository forks
- 7,130
- 7-day trend score
- 53
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 17 May 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Grok Build (Cursor)
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/phaserjs/phaser/particles)