| Package | org.flintparticles.twoD.actions |
| Class | public class Explosion |
| Inheritance | Explosion ActionBase Object |
| Implements | Resetable, FrameUpdatable |
| Property | Defined 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 | ||
![]() | priority : 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 | ||
| Method | Defined 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 | ||
removedFromEmitter(emitter:Emitter):void [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 | ||
[override]
Calculates the effect of the blast and shockwave on the particle at this
time. | Explosion | ||
| depth | property |
depth:NumberThe depth (front-edge to back-edge) of the shock wave.
public function get depth():Number public function set depth(value:Number):void| epsilon | property |
epsilon:NumberThe 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.
public function get epsilon():Number public function set epsilon(value:Number):void| expansionRate | property |
expansionRate:NumberThe rate at which the shockwave moves out from the explosion, in pixels per second.
public function get expansionRate():Number public function set expansionRate(value:Number):void| power | property |
power:NumberThe strength of the explosion - larger numbers produce a stronger force.
public function get power():Number public function set power(value:Number):void| x | property |
x:NumberThe x coordinate of the center of the explosion.
public function get x():Number public function set x(value:Number):void| y | property |
y:NumberThe y coordinate of the center of the explosion.
public function get y():Number public function set y(value:Number):void| 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.
Parameterspower: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
| addedToEmitter | () | method |
override public function addedToEmitter(emitter:Emitter):voidAdds 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):voidCalled 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):voidRemoves 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():voidResets the explosion to its initial state, so it can start again.
| update | () | method |
override public function update(emitter:Emitter, particle:Particle, time:Number):voidCalculates 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