How do I?: Using multiple particles from 1 emitter, (and adding rotation/opacity)
Bottom of Page1 to 2 of 2
-
- CommentAuthorsteelcurtn75
- CommentTimeDec 12th 2012
So I'm somewhat of an AS3 noob anyway, but I'm trying to figure out how to use Flint. Basically I have 6 different particles in my library (called scent_01, scent_02, etc). I would like each of these shapes to come out from the emitter at random, and slow sort of float out from the center... I've got 1 particle doing that now, but want them all to come out.
I'd also like them to rotate slightly and vary in opacity. Any help?
Here is what I have now...
import flash.geom.Point;
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();
var renderer:DisplayObjectRenderer = new DisplayObjectRenderer();
addChild( renderer );
renderer.addEmitter( emitter );
emitter.x = 15;
emitter.y = 20;
emitter.counter = new SineCounter(1, 10, 20);
emitter.counter = new Steady( 5 );
emitter.addInitializer( new ImageClass( scent_01 ) );
emitter.addInitializer( new Position( new PointZone( new Point( 150, 100 ) ) ) );
emitter.addInitializer( new Velocity( new DiscZone( new Point( 0, 0 ), 100, 50 ) ) );
emitter.addAction( new Move() );
emitter.start(); -
- CommentAuthorRichard
- CommentTimeJan 20th 2013
var emitter:Emitter2D = new Emitter2D();
var renderer:DisplayObjectRenderer = new DisplayObjectRenderer();
addChild( renderer );
renderer.addEmitter( emitter );
emitter.x = 15;
emitter.y = 20;
emitter.counter = new SineCounter(1, 10, 20);
emitter.counter = new Steady( 5 );
emitter.addInitializer( new ImageClasses( scent_01, scent_02, scent_03, scent_04, scent_05, scent_06 ) );
emitter.addInitializer( new Position( new PointZone( new Point( 150, 100 ) ) ) );
emitter.addInitializer( new Velocity( new DiscZone( new Point( 0, 0 ), 100, 50 ) ) );
emitter.addInitializer( new AlphaInit( 0.1, 1 ) );
emitter.addInitializer( new RotateVelocity( -1, 1 );
emitter.addAction( new Move() );
emitter.addAction( new Rotate() );
emitter.start();
1 to 2 of 2
