| Package | org.flintparticles.twoD.actions |
| Class | public class Explosion |
| Inheritance | Explosion ActionBase |
| Implements | FrameUpdatable, Resetable |
| 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
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
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 | ||
|
Calculates the effect of the blast and shockwave on the particle at this
time.
| Explosion | ||
| depth | property |
depth:Number [read-write]The depth (front-edge to back-edge) of the shock wave.
Implementation public function get depth():Number
public function set depth(value:Number):void
| epsilon | property |
epsilon:Number [read-write]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
| expansionRate | property |
expansionRate:Number [read-write]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
| power | property |
power:Number [read-write]The strength of the explosion - larger numbers produce a stronger force.
Implementation public function get power():Number
public function set power(value:Number):void
| x | property |
x:Number [read-write]The x coordinate of the center of the explosion.
Implementation public function get x():Number
public function set x(value:Number):void
| y | property |
y:Number [read-write]The y coordinate of the center of the explosion.
Implementation 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 |
public override function addedToEmitter(emitter:Emitter):voidAdds an UpdateOnFrame activity to the emitter to call this objects frameUpdate method once per frame.
Parametersemitter: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.
Parametersemitter:Emitter — The emitter that is using this action.
|
|
time:Number — The duration of the current animation frame.
|
See also
| removedFromEmitter | () | method |
public override function removedFromEmitter(emitter:Emitter):voidRemoves the UpdateOnFrame activity that was added to the emitter in the addedToEmitter method.
Parametersemitter: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 |
public override 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.
Parametersemitter: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