class flixel.effects.particles.FlxParticle extends FlxSprite implements IFlxParticle

Available on all platforms

This is a simple particle class that extends the default behavior * of FlxSprite to have slightly more specialized behavior * common to many game scenarios. You can override and extend this class * just like you would FlxSprite. While FlxEmitter * used to work with just any old sprite, it now requires a * FlxParticle based class.

Instance Fields

var friction:Float

Determines how quickly the particles come to rest on the ground. * Only used if the particle has gravity-like acceleration applied.

var lifespan:Float

How long this particle lives before it disappears. * NOTE: this is a maximum, not a minimum; the object * could get recycled before its lifespan is up.

var maxLifespan:Float

Helper variable for fading, scaling and coloring particle.

var rangeAlpha:Float

Range of alpha change during particle's life

var rangeBlue:Float

Range of blue color component change during particle's life

var rangeGreen:Float

Range of green color component change during particle's life

var rangeRed:Float

Range of red color component change during particle's life

var rangeScale:Float

Range of scale change during particle's life

var startAlpha:Float

Start value for particle's alpha

var startBlue:Float

Start value for particle's blue color component

var startGreen:Float

Start value for particle's green color component

var startRed:Float

Start value for particle's red color component

var startScale:Float

Start value for particle's scale.x and scale.y

var useColoring:Bool

If this is set to true, particles will change their color * based on their lifespan and start and range color components values.

var useFading:Bool

If this is set to true, particles will slowly fade away by * decreasing their alpha value based on their lifespan.

var useScaling:Bool

If this is set to true, particles will slowly decrease in scale * based on their lifespan. * WARNING: This severely impacts performance on flash target.

function new():Void

Instantiate a new particle. Like FlxSprite, all meaningful creation * happens during loadGraphic() or makeGraphic() or whatever.

function onEmit():Void

Triggered whenever this object is launched by a FlxEmitter. * You can override this to add custom behavior like a sound or AI or something.

function reset(X:Float, Y:Float):Void

function update():Void

The particle's main update logic. Basically it checks to see if it should * be dead yet, and then has some special bounce behavior if there is some gravity on it.