Jellyfish in AS3: Playing with Timer()

Sticky Elemental Snow

Here, I've updated an old timeline coded experiment to AS3. This is a fine example of how much easier it is to organize code and events in AS3 than it used to be.

There are two main time-dependent events taking place: the drifting of the jellyfish and the occasional bioluminescent effect.

In the document class, when creating each jelly fish instance, I've saved a reference to it in an array. This array is then passed to the class managing the drifting effect. The drift class then cycles through each jelly and repositions it. The structures are not compeletely clean, though, because I've stored two properties (vx & vy) on the jellies themselves, that I could have stored in an array in the drift class. Oh well, that's for the next version, I guess.

For the bioluminescent effect, the lightUp class periodically selects a random jelly and lights up it's "dots". The visual effect is subtle, and you have to pay attention to catch it happening.


--> Download Source Files <--