Flint Particle System Forum - Performance - Particles2011-12-11T17:52:14+00:00http://flintparticles.org/forum/
Lussumo Vanilla & Feed Publisher
Performance - Particleshttp://flintparticles.org/forum/comments.php?DiscussionID=435&Focus=1482#Comment_14822010-12-16T22:28:21+00:002011-12-11T17:52:14+00:00venhttp://flintparticles.org/forum/account.php?u=447
I'm working on a title matching game, and when multiple matches happen I remove the tiles and put a particle explosion in the place of each of the tiles. Without the explosions, my frame rate stays ...
var emitter:Emitter2D = new Emitter2D(); emitter.counter = new Blast( 50 ); emitter.addInitializer( new SharedImage( new Line( 1 ) ) ); emitter.addInitializer( new ColorInit( colorMin, colorMax ) ); emitter.addInitializer( new Velocity( new DiscZone( new Point( 0, 0 ), 100, 100 ) ) ); emitter.addInitializer( new Lifetime( 0.2, 0.4 ) );
emitter.addAction( new Age() ); emitter.addAction( new Move() ); emitter.addAction( new RotateToDirection() );
I create only one renderer, initialized as:
renderer = new BitmapRenderer( new Rectangle( 0, 0, stageWidth, stageHeight ) ); renderer.addFilter( new BlurFilter( 2, 2, 1 ) ); renderer.addFilter( new ColorMatrixFilter( [ 1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0.95,0 ] ) ); addChild( renderer );
In reading an old post it was recommend to keep the rectangle area small when using BitmapRenderer. Currently, my BitmapRenderer is set to the entire stage to cover 3-8 emitters for the single renderer than can be generated.
Is it advisable to keep one emitter per renderer and reduce the area size to cover only that explosion? If so, what would be the best way to removed the renderer after the explosion has completed. Should I attach a listener to renderer and then remove itself. I'm asking before I go rip up a bunch of code.... Thanks.
-ven]]>
Performance - Particleshttp://flintparticles.org/forum/comments.php?DiscussionID=435&Focus=1487#Comment_14872010-12-20T08:01:33+00:002011-12-11T17:52:14+00:00Richardhttp://flintparticles.org/forum/account.php?u=1
Listen for the emitterEmpty event to indicate that there are no more particles on the emitter, then stop the emitter, remove it from the renderer and remove the renderer from the ...
emitter.addEventListener( EmitterEvent.EMITTER_EMPTY, cleanUp );