Skip to content

Commit

Permalink
Missing usage of particleClass in FlxEmitter
Browse files Browse the repository at this point in the history
FlxEmitter now uses the custom particle class to recycle instead of FlxParticle.
Fixed FlixelCommunity#6, AdamAtomic#226
  • Loading branch information
moly committed Sep 17, 2012
1 parent 2c1e5dc commit ec4e880
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions org/flixel/FlxEmitter.as
Expand Up @@ -123,7 +123,7 @@ package org.flixel
minRotation = -360;
maxRotation = 360;
gravity = 0;
particleClass = null;
particleClass = FlxParticle;
particleDrag = new FlxPoint();
frequency = 0.1;
lifespan = 3;
Expand Down Expand Up @@ -177,10 +177,7 @@ package org.flixel
var i:uint = 0;
while(i < Quantity)
{
if(particleClass == null)
particle = new FlxParticle();
else
particle = new particleClass();
particle = new particleClass();
if(Multiple)
{
randomFrame = FlxG.random()*totalFrames;
Expand Down Expand Up @@ -290,7 +287,7 @@ package org.flixel
*/
public function emitParticle():void
{
var particle:FlxParticle = recycle(FlxParticle) as FlxParticle;
var particle:FlxParticle = recycle(particleClass) as FlxParticle;
particle.lifespan = lifespan;
particle.elasticity = bounce;
particle.reset(x - (particle.width>>1) + FlxG.random()*width, y - (particle.height>>1) + FlxG.random()*height);
Expand Down

0 comments on commit ec4e880

Please sign in to comment.