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

  1.  
    Hello,
    I'm a Flint newbie who's modifying the Firework example. I have a particle that serves as the "firework" before the explosion, and I have the "firework bloom" post-explosion.

    I need to get the firework particle to move to a random (x, -y) point on the stage, where its lifetime will expire and the firework bloom will appear.

    I've tried using TweenPosition constructor, but it won't accept Math.random. Any help would be appreciated.
    Ian
    • CommentAuthorRichard
    • CommentTimeJun 24th 2009
     
    Hi Ian

    One important feature of Flint is the simplicity of the actions - combining multiple actions creates complex effects but each action class is quite simple. As such, take a look inside the TweenPosition class. It's quite simple, with four getter/setter pairs, a constructor, and a three line update method that actually does the work. Hopefully, from this, you could create your own action to do as you need - changing the constructor to set the endX and endY to random values might be all that's required.

    Richard