Flint Particle System Forum - Emitting particles to random points Wed, 24 Nov 2010 23:29:56 +0000 http://flintparticles.org/forum/ Lussumo Vanilla 1.1.10 & Feed Publisher Emitting particles to random points http://flintparticles.org/forum/comments.php?DiscussionID=223&Focus=822#Comment_822 http://flintparticles.org/forum/comments.php?DiscussionID=223&Focus=822#Comment_822 Thu, 18 Jun 2009 20:23:17 +0100 ianhill090776 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 ]]>
Emitting particles to random points http://flintparticles.org/forum/comments.php?DiscussionID=223&Focus=833#Comment_833 http://flintparticles.org/forum/comments.php?DiscussionID=223&Focus=833#Comment_833 Wed, 24 Jun 2009 06:09:01 +0100 Richard
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 ]]>