Blast Effect
The blast effect creates a one-shot explosion of particles from an item’s center.
Usage
app.applyEffect(item, 'blast', {
color: '#ef4444',
radius: 100,
count: 20
});
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
color |
string | '#ef4444' |
Particle color |
radius |
number | 100 | Blast radius/speed |
count |
number | 20 | Number of particles |
Example
const star = app.create({
type: 'star',
position: [400, 300],
radius: 30,
fillColor: '#fbbf24'
});
// Trigger blast
app.applyEffect(star, 'blast', {
color: '#fbbf24',
radius: 150,
count: 30
});
How It Works
- Particles spawn at the item’s center
- Particles explode outward
- Particles fade and are removed
- Effect is one-shot (not looping)
Persistence
Blast effects are transient - they are not saved with the scene since they are one-shot animations.
Use Cases
- Celebration/reward feedback
- Impact effects
- Attention grabbing
- Transition effects