Packageorg.flintparticles.twoD.actions
Classpublic class Accelerate
InheritanceAccelerate Inheritance ActionBase Inheritance Object

The Accelerate Action adjusts the velocity of each particle by a constant acceleration. This can be used, for example, to simulate gravity.



Public Properties
 PropertyDefined By
 Inheritedpriority : int
Returns a default priority of 0 for this action.
ActionBase
  x : Number
The x coordinate of the acceleration, in pixels per second per second.
Accelerate
  y : Number
The y coordinate of the acceleration, in pixels per second per second.
Accelerate
Protected Properties
 PropertyDefined By
 Inherited_priority : int = 0
ActionBase
Public Methods
 MethodDefined By
  
Accelerate(accelerationX:Number = 0, accelerationY:Number = 0)
The constructor creates an Acceleration action for use by an emitter.
Accelerate
 Inherited
addedToEmitter(emitter:Emitter):void
This method does nothing.
ActionBase
 Inherited
This method does nothing.
ActionBase
  
update(emitter:Emitter, particle:Particle, time:Number):void
[override] Applies the acceleration to a particle for the specified time period.
Accelerate
Property Detail
xproperty
x:Number

The x coordinate of the acceleration, in pixels per second per second.


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

The y coordinate of the acceleration, in pixels per second per second.


Implementation
    public function get y():Number
    public function set y(value:Number):void
Constructor Detail
Accelerate()Constructor
public function Accelerate(accelerationX:Number = 0, accelerationY:Number = 0)

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

Parameters
accelerationX:Number (default = 0) — The x coordinate of the acceleration to apply, in pixels per second per second.
 
accelerationY:Number (default = 0) — The y coordinate of the acceleration to apply, in pixels per second per second.

See also

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

Applies the acceleration to a particle for the specified time period.

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.

See also