Flint Particle System Forum - Adding Age seems to be breaking it... 2010-12-26T16:08:31+00:00 http://flintparticles.org/forum/ Lussumo Vanilla & Feed Publisher Adding Age seems to be breaking it... http://flintparticles.org/forum/comments.php?DiscussionID=204&Focus=773#Comment_773 2009-04-20T13:48:18+01:00 2010-12-26T16:08:31+00:00 BillyT http://flintparticles.org/forum/account.php?u=189 Hiya, I've been playing around with this all morning and it seems great, but I'm a little confused - I'm trying to implement a glitter-type effect, and it's getting there, but I can't work out how ...
I've been playing around with this all morning and it seems great, but I'm a little confused - I'm trying to implement a glitter-type effect, and it's getting there, but I can't work out how to Age or restart the process. I've added in the Age below and it just stops everything - what is it I'm missing here...? Also, what's the simplest way to continually generate particles from the original source?

emitter = new Emitter2D();
particles = Particle2DUtils.createPixelParticlesFromBitmapData( bmd, emitter.particleFactory, 50, 75);
emitter.addExistingParticles( particles, false );

emitter.counter = new Steady( 250 );

var renderer:PixelRenderer = new PixelRenderer(new Rectangle( 0, 0, 500, 255 ));
renderer.addEmitter( emitter );
addChild( renderer );

emitter.counter = new Steady(250);

emitter.addInitializer( new Lifetime( 1 ) );
emitter.addAction(new Age());
emitter.addAction (new Accelerate( 0, 0));
emitter.addAction( new RandomDrift( 40, 40 ) );
emitter.addAction( new Move() );
emitter.addAction(new Fade());


emitter.start();

Thanks for your help, and sorry for being stupid!

Billy]]>
Adding Age seems to be breaking it... http://flintparticles.org/forum/comments.php?DiscussionID=204&Focus=774#Comment_774 2009-04-20T20:15:36+01:00 2010-12-26T16:08:31+00:00 Richard http://flintparticles.org/forum/account.php?u=1 The lifetime initializer isn't being applied to the particles, because you're adding it after you've added the particles to the emitter. Try this. emitter = new ...
emitter = new Emitter2D();
emitter.addInitializer( new Lifetime( 1 ) ); // add the initializer
particles = Particle2DUtils.createPixelParticlesFromBitmapData( bmd, emitter.particleFactory, 50, 75);
emitter.addExistingParticles( particles, true ); // true causes it to apply the initializer to the particles

var renderer:PixelRenderer = new PixelRenderer(new Rectangle( 0, 0, 500, 255 ));
renderer.addEmitter( emitter );
addChild( renderer );

emitter.addAction(new Age());
emitter.addAction( new RandomDrift( 40, 40 ) );
emitter.addAction( new Move() );
emitter.addAction(new Fade());

emitter.start();
]]>
Adding Age seems to be breaking it... http://flintparticles.org/forum/comments.php?DiscussionID=204&Focus=776#Comment_776 2009-04-20T22:58:12+01:00 2010-12-26T16:08:31+00:00 BillyT http://flintparticles.org/forum/account.php?u=189 Thank you, that's really useful. Thanks for a great system, and thanks for the quick response!