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. |
The x acceleration of this Particle.
The y acceleration of this Particle.
The alpha value of this Particle.
The angle of this Particle in degrees.
The bounciness, or restitution, of this Particle.
The data used by the ease equation.
The delay applied to this Particle upon emission, in ms.
The Emitter to which this Particle belongs.
A Particle can only belong to a single Emitter and is created, updated and destroyed via it.
The texture frame used to render this Particle.
The lifespan of this Particle in ms.
The current life of this Particle in ms.
The normalized lifespan T value, where 0 is the start and 1 is the end.
The maximum horizontal velocity this Particle can travel at.
The maximum vertical velocity this Particle can travel at.
The angle of this Particle in radians.
The horizontal scale of this Particle.
The vertical scale of this Particle.
The tint applied to this Particle.
The x velocity of this Particle.
The y velocity of this Particle.
The x coordinate of this Particle.
The y coordinate of this Particle.
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. |
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). |
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. |
Checks to see if this Particle is alive and updating.
true
if this Particle is alive and updating, otherwise false
.
Resets the position of this particle back to zero.
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.