Version:

A Particle is a simple Game Object controlled by a Particle Emitter and Manager, and rendered by the Manager. It uses its own lightweight physics system, and can interact only with its Emitter's bounds and zones.

```
new Particle(emitter)
```

name | type | description |
---|---|---|

emitter | Phaser.GameObjects.Particles.ParticleEmitter |
The Emitter to which this Particle belongs. |

Since: 3.0.0

The x acceleration of this Particle.

number

Default: 0

Since: 3.0.0

The y acceleration of this Particle.

number

Default: 0

Since: 3.0.0

The alpha value of this Particle.

number

Default: 1

Since: 3.0.0

The angle of this Particle in degrees.

number

Default: 0

Since: 3.0.0

The bounciness, or restitution, of this Particle.

number

Default: 0

Since: 3.0.0

The data used by the ease equation.

object

Since: 3.0.0

The delay applied to this Particle upon emission, in ms.

number

Default: 0

Since: 3.0.0

The Emitter to which this Particle belongs.

A Particle can only belong to a single Emitter and is created, updated and destroyed via it.

Since: 3.0.0

frame: Phaser.Textures.Frame

The texture frame used to render this Particle.

Default: null

Since: 3.0.0

The lifespan of this Particle in ms.

number

Default: 1000

Since: 3.0.0

The current life of this Particle in ms.

number

Default: 1000

Since: 3.0.0

The normalized lifespan T value, where 0 is the start and 1 is the end.

number

Default: 0

Since: 3.0.0

The maximum horizontal velocity this Particle can travel at.

number

Default: 10000

Since: 3.0.0

The maximum vertical velocity this Particle can travel at.

number

Default: 10000

Since: 3.0.0

The angle of this Particle in radians.

number

Default: 0

Since: 3.0.0

The horizontal scale of this Particle.

number

Default: 1

Since: 3.0.0

The vertical scale of this Particle.

number

Default: 1

Since: 3.0.0

The tint applied to this Particle.

number

Since: 3.0.0

The x velocity of this Particle.

number

Default: 0

Since: 3.0.0

The y velocity of this Particle.

number

Default: 0

Since: 3.0.0

The x coordinate of this Particle.

number

Default: 0

Since: 3.0.0

The y coordinate of this Particle.

number

Default: 0

Since: 3.0.0

Checks if this Particle is still within the bounds defined by the given Emitter.

If not, and depending on the Emitter collision flags, the Particle may either stop or rebound.

name | type | description |
---|---|---|

emitter | Phaser.GameObjects.Particles.ParticleEmitter |
The Emitter to check the bounds against. |

Since: 3.0.0

An internal method that calculates the velocity of the Particle.

name | type | description |
---|---|---|

emitter | Phaser.GameObjects.Particles.ParticleEmitter |
The Emitter that is updating this Particle. |

delta | number |
The delta time in ms. |

step | number |
The delta value divided by 1000. |

processors | array |
Particle processors (gravity wells). |

Since: 3.0.0

Starts this Particle from the given coordinates.

name | type | description |
---|---|---|

x | number |
The x coordinate to launch this Particle from. |

y | number |
The y coordinate to launch this Particle from. |

Since: 3.0.0

Checks to see if this Particle is alive and updating.

`true`

if this Particle is alive and updating, otherwise `false`

.

- boolean

Since: 3.0.0

Resets the position of this particle back to zero.

Since: 3.16.0

The main update method for this Particle.

Updates its life values, computes the velocity and repositions the Particle.

name | type | description |
---|---|---|

delta | number |
The delta time in ms. |

step | number |
The delta value divided by 1000. |

processors | array |
An optional array of update processors. |

Returns `true`

if this Particle has now expired and should be removed, otherwise `false`

if still active.

- boolean

Since: 3.0.0

Possible examples