Fork me on GitHub
Not signed in (Sign In)

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

    • CommentAuthormichaelk
    • CommentTimeJan 15th 2010
     
    Thanks for the amazing package!

    I am trying to create a steam effect. I would like the particles to fade in quickly but then follow a aging process similar to smoke. I tried using the TwoWay modifier but it affected all the actions. Is there another way to accomplish this? Thanks in advance for any ideas!

    Here is the code I'm working with:

    import org.flintparticles.common.actions.*;
    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.*;
    import org.flintparticles.common.energyEasing.*;


    var wrap_steam:Emitter2D = new Emitter2D();
    wrap_steam.counter = new Steady( 10 );

    wrap_steam.addInitializer( new Lifetime( 3, 7 ) );
    wrap_steam.addInitializer( new Position( new LineZone( new Point( -40, 0 ), new Point( 40, 0 ) ) ) );
    wrap_steam.addInitializer( new Velocity( new RectangleZone(-10, -30, 10, 0 )) );
    wrap_steam.addInitializer( new SharedImage( new RadialDot( 3 ) ) );

    wrap_steam.addAction( new Age( ) );
    wrap_steam.addAction( new Move( ) );
    wrap_steam.addAction( new LinearDrag( 0.01 ) );
    wrap_steam.addAction( new ScaleImage( 2, 20 ) );
    wrap_steam.addAction( new Fade( .1, 0 ) );
    wrap_steam.addAction( new RandomDrift( 20, 20 ) );

    wrap_steam.x = 100;
    wrap_steam.y = 180;
    wrap_steam.start( );

    var renderer3:BitmapRenderer = new BitmapRenderer( new Rectangle( 0, 0, 200, 200 ) );
    renderer3.addEmitter( wrap_steam );
    addChild( renderer3 );
    • CommentAuthorRichard
    • CommentTimeJan 16th 2010
     
    You probably need a custom Action. Flint is designed so that extending it with custom behaviours is pretty easy, take a look at the source code for any of the existing Actions. Also, Ryan's Flinteroids tutorial includes creating custom Actions.