Flint Particle System Forum - Adding Age seems to be breaking it... Sun, 26 Dec 2010 16:08:03 +0000 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher Adding Age seems to be breaking it... http://flintparticles.org/forum/comments.php?DiscussionID=204&Focus=773#Comment_773 http://flintparticles.org/forum/comments.php?DiscussionID=204&Focus=773#Comment_773 Mon, 20 Apr 2009 13:48:18 +0100 BillyT
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 http://flintparticles.org/forum/comments.php?DiscussionID=204&Focus=774#Comment_774 Mon, 20 Apr 2009 20:15:36 +0100 Richard
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 http://flintparticles.org/forum/comments.php?DiscussionID=204&Focus=776#Comment_776 Mon, 20 Apr 2009 22:58:12 +0100 BillyT