Welcome to SwirlyLand!
I'm particularly proud of this applet because I pretty much wrote it by accident. The original idea was to construct an animated icon that would represent a "zooming" activity -- either in or out. I found the code for a swirl-like polygon in the book, Core Java. But then I had to come up with a function to rotate the polygon. This involved some hits and misses, and one of the misses turned out to be pretty cool! It seems I typed an asterisk when I should've typed a plus sign. What you're seeing in the applet below is an instantiation of a Swirlies object, which itself creates 10 randomly-colored, randomly-sized Swirly objects, each of which rotates and re-draws itself 100 times. Other Swirlies objects may be created by clicking in the applet region but, for your computer's sake, don't go crazy. The Swirly class is derived from the Swirl class: they differ by only two characters in their respective rotate methods. You can see what I was originally trying to do by holding down the SHIFT key while clicking the mouse in the applet region, but to get the full effect, wait until the Swirlies object dies.
Source code: SwirlyLand.java, Swirlies.java, Swirly.java, Swirl.java
Back to... [ Jim's homely page ] [ Jim's work ]