Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

finished basictween, before converting basicphysics

  • Loading branch information...
commit be18ccca10c22c719133b22cdb685015733e0c9b 1 parent caeb834
@andrewfitz authored
View
2  changelog.txt
@@ -27,6 +27,8 @@ Release Candidate 1 (2009/7/29):
Partigen:
-added: toXML() and fromXML() methods to most classes
+ -added: emitter.enableEvents:Boolean to enable/disable particle events
+ -changed: emtiters no longer broadcast particle events by default
-changed: life is now: life and lifeSpread
-changed: angle is now: angle and angleSpread
-changed: eps is now a Number (not int), and allows for 1 emission greater than 1 second
View
2  com/desuade/motion/bases/BaseTicker.as
@@ -139,7 +139,7 @@ package com.desuade.motion.bases {
*/
protected static function update($u:Object):void {
var times:int = getTimer();
- for each (var item in _holder) {
+ for each (var item:BasePrimitive in _holder) {
item.render(times);
}
dispatchEvent(new MotionEvent(MotionEvent.UPDATED));
View
9 com/desuade/partigen/emitters/BasicEmitter.as
@@ -92,6 +92,11 @@ package com.desuade.partigen.emitters {
public var groupProximity:int;
/**
+ * Enable particle BORN and DIED events. The default is false;
+ */
+ public var enableEvents:Boolean = false;
+
+ /**
* @private
*/
protected var _id:int;
@@ -191,7 +196,7 @@ package com.desuade.partigen.emitters {
np.x = this.x;
np.y = this.y;
np.z = this.z;
- dispatchEvent(new ParticleEvent(ParticleEvent.BORN, {particle:np}));
+ if(enableEvents) dispatchEvent(new ParticleEvent(ParticleEvent.BORN, {particle:np}));
renderer.addParticle(np);
}
}
@@ -236,7 +241,7 @@ package com.desuade.partigen.emitters {
* @private
*/
public function dispatchDeath(p:BasicParticle):void {
- dispatchEvent(new ParticleEvent(ParticleEvent.DIED, {particle:p}));
+ if(enableEvents) dispatchEvent(new ParticleEvent(ParticleEvent.DIED, {particle:p}));
}
/**
View
2  com/desuade/partigen/emitters/Emitter.as
@@ -129,7 +129,7 @@ package com.desuade.partigen.emitters {
np.z = this.z;
if(life > 0) np.addLife(randomLife());
controllers.particle.attachAll(np, this);
- dispatchEvent(new ParticleEvent(ParticleEvent.BORN, {particle:np}));
+ if(enableEvents) dispatchEvent(new ParticleEvent(ParticleEvent.BORN, {particle:np}));
np.startControllers();
renderer.addParticle(np);
}
Please sign in to comment.
Something went wrong with that request. Please try again.