A Firefly’s worst enemy- interactive java script project

As final project for the Algorithms course, a colleague and I were tasked to create a program that featured (almost) all of the material that was taught during the module. In the end we came up with a game where the player is able to drag a lamp over the screen, which is attached to a rope. By letting go of the rope a mass-spring-damper system takes care of the transient bouncing animation. If any of the firefly’s are caught in its path, they will explode and make a satisfying electrical sound. The fireflies are programmed such that they will be attracted by the lamp, fly in flocks over an ever-changing vector path that provides them the direction they should be going in. the vector path is defined by Perlin Noise, which is a gradual randomization creating the flowing animation of the firefly flocks.

However, Processing (the program you need to run the interaction) can’t handle too many sounds at once so if the sound starts to act unexpected, simply close and reopen the program. Instructions for the program are: left mouse button to displace the lamp, and letting go of the left mouse button will make it oscillate to its equilibrium position. The right mouse button is to spawn fireflies but take it easy. The program can be downloaded from HERE, but below is a screenshot if you don’t want to.

image of interactive program

Leave a Reply

Your email address will not be published. Required fields are marked *