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

    • CommentAuthorezra
    • CommentTimeJul 10th 2009
     
    I'm trying to generate a set of particles over over a BitmapDataZone.

    I'de like to be able to sweep them away with the mouse, and then have them move back to there original positions.

    I'm pretty new to all of this. Any suggestions?

    Flint rocks! Thanks for providing an amazing resource.

    -ezra
    • CommentAuthorRichard
    • CommentTimeJul 11th 2009
     
    First step is to remember each particle's starting position. This will need a custom initializer that stores the particle's start position in the particle's dictionary (make sure this initializer has a lower priority than the position initializer so it runs after).

    Sweeping the particle's away could be done with an effect based on the mouse position. You could try a MouseAntiGravity action, or you could make your own.

    Finally, returning the particles to their original position could be done with a simple tween or with some other effect like a custom gravity well based on each particle's start position.