gskinner.com: gBlog: FlashMX 2004 source code, news, reviews and opinions
Back to gBlog Main gskinner.com website: source code, portfolio, etc. contact Grant Skinner

Syndication
RSS 1.0
RSS 2.0


Subscribe
Enter your email address to be notified when posts are added.

Search

Resources
Conference Session Notes

Flash Blogs
Waxpraxis
Philterblog
W3Blog
Jonas Galvez
Josh Dura
Quasimondo
Flashguru
Sean Voisen
Colin Moock
Flazoom
Greg Burch
Pope De Flash
Peter Hall
Glyn Thomas
actionscript.com
Princess Pegg


Aggregators
Flog
FullAsAGoog
MXNA
Hall of Justhese


« Experiment: Crystallization simulation | Back to Main | Philter (Phil Chung) joins gskinner.com »

April 18, 2004


IMPORTANT NOTE: This is an old archive. It is only here to support outdated external links. To view the updated version of this archive, please go to the blog index, and search for the title of this document using the search form.

Experiment: Proximity Fireflies
Posted by Grant

Firefly communication through bioluminescence is a beautiful thing to watch, and I felt it could be easily modeled using my ProximityManager class, and a simple tolerance/potential system. I tried to make this system mimic the real interaction of Fireflies in nature, and was inspired by an article I found about an artist's video of Fireflies in a Malaysian rain forest.

The Firefly sprites in this simulation fly around the screen, completely invisible in the dark. There are 350 Fireflies in the system, 90% male, 10% female. Female Fireflies blink at semi-random intervals - the light excites nearby males, who in turn may blink. This potentially triggers a cascade as males blink and excite other males (kind of kinky) who blink in turn, creating waves of light.

The more excited a Firefly is when it blinks, the brighter and whiter it glows (hence producing more light, and exciting other Fireflies more). This is achieved with simple scaling, alpha, and color transformations.

This experiment was very easy to code, but if took awhile to balance the tolerances and values to achieve the desired effect. I'm quite impressed that the Flash 7 player has enough power to track 350 sprites with this kind of behaviour as effectively as it does.

The logic is very similar to that used in my old crystallization experiment, but freed from the constraints of a rigid grid through the use of my ProximityManager class.

I'm going to be doing a show and tell about the code behind this experiment at the Edmonton Flash User Group meeting tomorrow, and might release the code on my blog in the next little while.

Here is all 2kb of it:







Posted @ 10:56 PM by Grant | TrackBack


Comments

Once again...

I bow before thee

Posted by: Moedit at April 19, 2004 12:33 AM

Nice piece of work!
Let me invite you in my montreal MMUG when you want to talk about it :)

Posted by: Martin Arvisais - FlashADN at April 20, 2004 09:01 AM


Hosting by NetKeepers.ca | Powered by Movable Type 2.661
The text content of this blog is licensed under a Creative Commons License. Graphics are ©2003 Grant Skinner.