Monday, February 1, 2010

Since the last one did too much...



Large Version Recommended.

In a departure from the previous project, I whipped up something that's just fun to look at. When the .swf loads, you'll get 4 little orbs of light that fly around randomly, leaving a trail of glowing embers. You can hit one with your mouse to cause it to pause and grow a bit. Clicking will produce a brand new one.

So nothing TOO crazy here, but each ember's flight path is based off its previous position. Every frame, the ember looks at its current move speed and then varies its vector by a small degree (between -.5 and .5, which when added 31 times per second really adds up!) In other words, you get generally smooth arcs instead of rapid sudden changes in movement. If you wanted to produce a slower, lazier arc, you'd just put a bit of a delay in the change in position. Maybe have it adjust its flight path every 15 frames instead of every single frame.

So, enjoy and gaze a bit!

No comments:

Post a Comment