Packageorg.flintparticles.twoD.actions
Classpublic class Explosion
InheritanceExplosion Inheritance ActionBase Inheritance Object
Implements Resetable, FrameUpdatable

The Explosion action applies a force on the particles to push them away from a single point - the center of the explosion. The force occurs instantaneously at the central point of the explosion and then ripples out in a shock wave.



Public Properties
 PropertyDefined By
  depth : Number
The depth (front-edge to back-edge) of the shock wave.
Explosion
  epsilon : Number
The minimum distance for which the explosion force is calculated.
Explosion
  expansionRate : Number
The rate at which the shockwave moves out from the explosion, in pixels per second.
Explosion
  power : Number
The strength of the explosion - larger numbers produce a stronger force.
Explosion
 Inheritedpriority : int
Returns a default priority of 0 for this action.
ActionBase
  x : Number
The x coordinate of the center of the explosion.
Explosion
  y : Number
The y coordinate of the center of the explosion.
Explosion
Protected Properties
 PropertyDefined By
 Inherited_priority : int = 0
ActionBase
Public Methods
 MethodDefined By
  
Explosion(power:Number = 0, x:Number = 0, y:Number = 0, expansionRate:Number = 300, depth:Number = 10, epsilon:Number = 1)
The constructor creates an Explosion action for use by an emitter.
Explosion
  
addedToEmitter(emitter:Emitter):void
[override] Adds an UpdateOnFrame activity to the emitter to call this objects frameUpdate method once per frame.
Explosion
  
frameUpdate(emitter:Emitter, time:Number):void
Called every frame before the particles are updated, this method calculates the current position of the blast shockwave.
Explosion
  
[override] Removes the UpdateOnFrame activity that was added to the emitter in the addedToEmitter method.
Explosion
  
reset():void
Resets the explosion to its initial state, so it can start again.
Explosion
  
update(emitter:Emitter, particle:Particle, time:Number):void
[override] Calculates the effect of the blast and shockwave on the particle at this time.
Explosion
Property Detail
depthproperty
depth:Number

The depth (front-edge to back-edge) of the shock wave.


Implementation
    public function get depth():Number
    public function set depth(value:Number):void
epsilonproperty 
epsilon:Number

The minimum distance for which the explosion force is calculated. Particles closer than this distance to the center of the explosion experience the explosion as it they were this distance away. This stops the explosion effect blowing up as distances get small.


Implementation
    public function get epsilon():Number
    public function set epsilon(value:Number):void
expansionRateproperty 
expansionRate:Number

The rate at which the shockwave moves out from the explosion, in pixels per second.


Implementation
    public function get expansionRate():Number
    public function set expansionRate(value:Number):void
powerproperty 
power:Number

The strength of the explosion - larger numbers produce a stronger force.


Implementation
    public function get power():Number
    public function set power(value:Number):void
xproperty 
x:Number

The x coordinate of the center of the explosion.


Implementation
    public function get x():Number
    public function set x(value:Number):void
yproperty 
y:Number

The y coordinate of the center of the explosion.


Implementation
    public function get y():Number
    public function set y(value:Number):void
Constructor Detail
Explosion()Constructor
public function Explosion(power:Number = 0, x:Number = 0, y:Number = 0, expansionRate:Number = 300, depth:Number = 10, epsilon:Number = 1)

The constructor creates an Explosion action for use by an emitter. To add an Explosion to all particles created by an emitter, use the emitter's addAction method.

Parameters
power:Number (default = 0) — The strength of the explosion - larger numbers produce a stronger force. (The scale of value has been altered from previous versions so small numbers now produce a visible effect.)
 
x:Number (default = 0) — The x coordinate of the center of the explosion.
 
y:Number (default = 0) — The y coordinate of the center of the explosion.
 
expansionRate:Number (default = 300) — The rate at which the shockwave moves out from the explosion, in pixels per second.
 
depth:Number (default = 10) — The depth (front-edge to back-edge) of the shock wave.
 
epsilon:Number (default = 1) — The minimum distance for which the explosion force is calculated. Particles closer than this distance experience the explosion as if they were this distance away. This stops the explosion effect blowing up as distances get small.

See also

Method Detail
addedToEmitter()method
override public function addedToEmitter(emitter:Emitter):void

Adds an UpdateOnFrame activity to the emitter to call this objects frameUpdate method once per frame.

Parameters

emitter:Emitter — The emitter this action has been added to.

See also

frameUpdate()method 
public function frameUpdate(emitter:Emitter, time:Number):void

Called every frame before the particles are updated, this method calculates the current position of the blast shockwave.

This method is called using an UpdateOnFrame activity that is created in the addedToEmitter method.

Parameters

emitter:Emitter — The emitter that is using this action.
 
time:Number — The duration of the current animation frame.

See also

removedFromEmitter()method 
override public function removedFromEmitter(emitter:Emitter):void

Removes the UpdateOnFrame activity that was added to the emitter in the addedToEmitter method.

Parameters

emitter:Emitter — The emitter this action has been added to.

See also

reset()method 
public function reset():void

Resets the explosion to its initial state, so it can start again.

update()method 
override public function update(emitter:Emitter, particle:Particle, time:Number):void

Calculates the effect of the blast and shockwave on the particle at this time.

This method is called by the emitter and need not be called by the user.

Parameters

emitter:Emitter — The Emitter that created the particle.
 
particle:Particle — The particle to be updated.
 
time:Number — The duration of the frame - used for time based updates.

See also