Welcome, Guest
Want to take part in these discussions? Sign in if you have an account, or apply for one below
-
- CommentAuthorJonsey
- CommentTimeNov 18th 2008
Hi, this might be ridicously simple to fix but I just can't find a solution to it. To me the two emitters and renderers are the same but the second emitter/renderer don't seem to generate the same amount of small instances of the particles and I don't know why. The .fla is 1292x190px. If there's no reasonable explanation I thought it was best to post it here, sorry if I was wrong.
I've posted the code below.
-Thank you in advance.
-------
import org.flintparticles.common.counters.*;
import org.flintparticles.common.displayObjects.RadialDot;
import org.flintparticles.common.initializers.*;
import org.flintparticles.twoD.actions.*;
import org.flintparticles.twoD.emitters.Emitter2D;
import org.flintparticles.twoD.initializers.*;
import org.flintparticles.twoD.renderers.*;
import org.flintparticles.twoD.zones.*;
var emitter:Emitter2D = new Emitter2D();
emitter.counter = new Steady( 1 );
emitter.addInitializer( new ImageClass( RadialDot, 2, 0xA6A6A6, "hardlight" ) );
emitter.addInitializer( new Lifetime( 11, 12 ) );
emitter.addInitializer( new Position( new LineZone( new Point( 100, 7 ), new Point( 600, 7 ) ) ) );
emitter.addInitializer( new Velocity( new PointZone( new Point( -5, 2 ) ) ) );
emitter.addInitializer( new ScaleImageInit( 0.5, 1.5 ) );
emitter.addAction( new Move() );
emitter.addAction( new DeathZone( new RectangleZone( 5, 5, 1290, 190 ), true ) );
emitter.addAction( new RandomDrift( -4, 3 ) );
var renderer:DisplayObjectRenderer = new DisplayObjectRenderer();
renderer.addEmitter( emitter );
addChild( renderer );
emitter.start();
emitter.runAhead( 15 );
var emitter2:Emitter2D = new Emitter2D();
emitter2.counter = new Steady( 1 );
emitter2.addInitializer( new ImageClass( RadialDot, 2, 0xA6A6A6, "hardlight" ) );
emitter2.addInitializer( new Position( new LineZone( new Point( 601, 7 ),new Point( 1291, 7 ) ) ) );
emitter2.addInitializer( new Velocity( new PointZone( new Point( 5, 2 ) ) ) );
emitter2.addInitializer( new ScaleImageInit( 0.5, 1.5 ) );
emitter2.addAction( new Move() );
emitter2.addAction( new DeathZone( new RectangleZone( 0, 0, 1292, 190 ), true ) );
emitter2.addAction( new RandomDrift( 4, 3 ) );
var renderer2:DisplayObjectRenderer = new DisplayObjectRenderer();
renderer2.addEmitter( emitter2 );
addChild( renderer2 );
emitter2.start();
emitter2.runAhead( 15 ); -
- CommentAuthorRichard
- CommentTimeNov 20th 2008
It doesn't look like the emitters create the same number of particles, but monitoring the number of particles shows that they do in fact create exactly the same number of particles. I think this is because the LineZone for emitter2 is longer than the LineZone for emitter so the particles for emitter2 are more spread out. They're also likely to be closer to the edge of the DeathZone so will die sooner. -
- CommentAuthorJonsey
- CommentTimeNov 20th 2008
Thank you so much Richard. I'll try it our right away.
1 to 3 of 3
