particles

Create and configure particle effects in Phaser 4 using ParticleEmitter, zones, and gravity wells.

Updated May 7, 2021
One-click install
npx skills add https://github.com/travispwingo/travispwingo.github.io --skill particles-travispwingo
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: particles
Source: https://github.com/travispwingo/travispwingo.github.io/tree/main/mario/docs/skills/particles
Command: npx skills add https://github.com/travispwingo/travispwingo.github.io --skill particles-travispwingo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building particle effects like explosions, fire, and smoke in Phaser 4 requires knowing the ParticleEmitter API, its flexible EmitterOp value formats, and zone systems, which are easy to misconfigure without a structured reference. ## Core Features & Use Cases - Emitter Creation and Configuration: Create flow or burst emitters with this.add.particles(), using flexible value formats like min/max ranges, start/end easing, and stepped sequences. - Zones and Processors: Add emission zones (random or edge), death zones, gravity wells, particle bounds, and custom ParticleProcessor classes for per-particle logic. - Lifecycle Control: Follow game objects, pre-warm emitters with advance, handle emit/death callbacks, and respond to start, stop, complete, and deathzone events. - Use Case: Build an explosion effect by creating an emitter with emitting: false, then calling explode(30) on impact, with scale and alpha easing to zero over each particle's lifespan. ## Quick Start Ask the AI to create a Phaser 4 particle emitter that bursts 20 particles with fading scale and alpha when an explosion occurs.

Frequently Asked Questions about particles

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a particle emitter in Phaser 4?▼

Call this.add.particles(x, y, texture, config) inside a Scene's create method. It returns a ParticleEmitter game object directly, since the ParticleEmitterManager was removed in v3.60. Configure speed, lifespan, scale, and alpha in the config object.

How do I make a one-shot explosion effect with Phaser particles?▼

Set emitting: false in the emitter config so it does not auto-start, then call emitter.explode(count) to emit a batch of particles at once. Alternatively, set frequency: -1 to put the emitter in explode mode permanently.

What is the difference between flow mode and explode mode in Phaser particles?▼

Flow mode emits a quantity of particles every frequency milliseconds, with frequency 0 meaning every frame. Explode mode uses frequency -1 and emits one batch per explode() call, then stops until called again.

Can Phaser particles follow a moving game object?▼

Yes, call emitter.startFollow(target, offsetX, offsetY, trackVisible) or set follow and followOffset in the emitter config. The emitter position tracks the target each frame, and trackVisible can mirror the target's visibility.

Why are my Phaser particles not emitting?▼

Check that emitting is not false and frequency is not -1, which requires explode() calls. Also verify the texture key is valid, since the emitter needs a loaded texture, and confirm active is true so the emitter updates.

How do I kill particles that leave an area in Phaser?▼

Add a deathZone with type 'onLeave' and a source shape implementing contains(x, y), such as a Phaser.Geom.Circle. Use type 'onEnter' instead to kill particles entering a region. Custom source objects with a contains method also work.