Packageorg.flintparticles.actions
Classpublic class MouseExplosion
InheritanceMouseExplosion Inheritance Action

The MouseExplosion action applies a force on the particle to push it away from the mouse. The force applied is inversely proportional to the square of the distance from the particle to the mouse.



Public Properties
 PropertyDefined by
  epsilon : Number
The minimum distance for which the explosion force is calculated.
MouseExplosion
  power : Number
The strength of the explosive force.
MouseExplosion
Public Methods
 MethodDefined by
  
MouseExplosion(power:Number, epsilon:Number = 1)
The constructor creates a MouseExplosion action for use by an emitter.
MouseExplosion
 Inherited
addedToEmitter(emitter:Emitter):void
The addedToEmitter method is called by the emitter when the Action is added to it It is called within the emitter's addAction method and need not be called by the user.
Action
 Inherited
The getDefaultPriority method is used to order the execution of actions.
Action
  
update(emitter:Emitter, particle:Particle, time:Number):void
The update method is used by the emitter to apply the action to every particle.
MouseExplosion
Property detail
epsilonproperty
epsilon:Number  [read-write]

The minimum distance for which the explosion force is calculated. Particles closer than this distance 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
powerproperty 
power:Number  [read-write]

The strength of the explosive force.

Implementation
    public function get power():Number
    public function set power(value:Number):void
Constructor detail
MouseExplosion()constructor
public function MouseExplosion(power:Number, epsilon:Number = 1)

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

Parameters
power:Number — The minimum distance for which the explosion force is calculated. Particles closer than this distance experience the explosion as it they were this distance away. This stops the explosion effect blowing up as distances get small.
 
epsilon:Number (default = 1)

See also

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

The update method is used by the emitter to apply the action to every particle. It is called within the emitter's update loop 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.