From ec4e880f2283999b115ca11641e12820603a1648 Mon Sep 17 00:00:00 2001 From: moly <0700689@live.abertay.ac.uk> Date: Mon, 17 Sep 2012 19:58:45 +0100 Subject: [PATCH] Missing usage of particleClass in FlxEmitter FlxEmitter now uses the custom particle class to recycle instead of FlxParticle. Fixed FlixelCommunity/flixel#6, AdamAtomic/flixel#226 --- org/flixel/FlxEmitter.as | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/org/flixel/FlxEmitter.as b/org/flixel/FlxEmitter.as index f39ee31d..babeab2c 100644 --- a/org/flixel/FlxEmitter.as +++ b/org/flixel/FlxEmitter.as @@ -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; @@ -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; @@ -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);