ÆFLASH

Circle Split

After seeing this flash doohickey and playing with it for a while, I noticed that it slows to a crawl and becomes unresponsive simply due to the sheer complexity of it all. I immediately saw some ways to optimize what it is doing, as it uses a rather simple approach as to what it's doing.

After a couple hours of hacking, I came up with this:

http://www.aeflash.com/misc/circlesplit2.swf

Graphics were cached to a single bitmap, and lighter-weight sprites were used instead of buttons. It still was a bit slow once you got deep into it. This was simply due to the thousands of mouse event listeners flash player had to keep track of. AFter a few more hours I have this:

http://www.aeflash.com/misc/circlesplit.swf

It uses a tree structure and a divide-and-conquer algorithm to delegate mouse events to the correct circle. Instead of having a O(n) search every mouse move, it now has a O(log(n)) search. It's very responsive, even with thousands of circles. I'll post the source later.

Have fun playing. And yes, it is possible to win...

gallery computational-art flash as3