Packageorg.flintparticles.twoD.actions
Classpublic class RandomDrift
InheritanceRandomDrift Inheritance ActionBase Inheritance Object

The RandomDrift action moves the particle by a random small amount every frame, causing the particle to drift around.



Public Properties
 PropertyDefined By
  driftX : Number
The maximum amount of horizontal drift in pixels per second.
RandomDrift
  driftY : Number
The maximum amount of vertical drift in pixels per second.
RandomDrift
 Inheritedpriority : int
Returns a default priority of 0 for this action.
ActionBase
Protected Properties
 PropertyDefined By
 Inherited_priority : int = 0
ActionBase
Public Methods
 MethodDefined By
  
RandomDrift(driftX:Number = 0, driftY:Number = 0)
The constructor creates a RandomDrift action for use by an emitter.
RandomDrift
 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] Calculates a random drift for this frame and applies it for the period of time indicated.
RandomDrift
Property Detail
driftXproperty
driftX:Number

The maximum amount of horizontal drift in pixels per second.


Implementation
    public function get driftX():Number
    public function set driftX(value:Number):void
driftYproperty 
driftY:Number

The maximum amount of vertical drift in pixels per second.


Implementation
    public function get driftY():Number
    public function set driftY(value:Number):void
Constructor Detail
RandomDrift()Constructor
public function RandomDrift(driftX:Number = 0, driftY:Number = 0)

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

Parameters
driftX:Number (default = 0) — The maximum amount of horizontal drift in pixels per second.
 
driftY:Number (default = 0) — The maximum amount of vertical drift in pixels per second.

See also

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

Calculates a random drift for this frame and applies it for the period of time indicated.

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