Here is a circular space filling thing I made a while back, and modified to code to meet the guidelines. I know you guys are going to say I copied Chaoswarp, but actually I didn’t. You can ask jerez_z if you wish, for I posted this at ffiles long before the contest began (http://ffiles.com/view_listing.php?sid=94&cat=18).
The motion was inspired by chaoswarp though, and I will make sure to give him part of the prize if I win with this one:hugegrin:
function MaxRadius(center1, dist) {
for (var n = 0; n<stack.length; n++) (Math.sqrt((stack[n].center.x-center1.x)*(stack[n].center.x-center1.x)+(stack[n].center.y-center1.y)*(stack[n].center.y-center1.y))-stack[n].radius<dist) ? dist=Math.sqrt((stack[n].center.x-center1.x)*(stack[n].center.x-center1.x)+(stack[n].center.y-center1.y)*(stack[n].center.y-center1.y))-stack[n].radius : null;
(dist>225 || dist<1) ? dist=[1, 225][int(dist>225)] : null;
return dist;
}
MovieClip.prototype.FollowPoint = function(p) {
this._x = this._x+(p.x-this._x)/36;
this._y = this._y+(p.y-this._y)/36;
};
function DrawCircle(center, radius) {
circle = _root.createEmptyMovieClip("circle"+(depth++), depth);
circle._x = 200+300*Math.cos(Math.random()*Math.PI*2);
circle._y = 200+300*Math.sin(Math.random()*Math.PI*2);
circle._alpha=0;
circle.center = center;
circle.radius = radius;
circle.onPress = function(){
this.removeMovieClip();
}
stack==undefined ? stack=[circle] : stack.push(circle);
circle.lineStyle(radius/2+2, Math.min(radius*3,200) <<16 |Math.min(radius*3,200) <<8 | 0, 100);
circle.moveTo(radius, 0);
for (var t = 0; t<=Math.PI*2; t += Math.PI/30) circle.lineTo(radius*Math.cos(t), radius*Math.sin(t));
circle._width = circle._height=radius*2.4;
circle.onEnterFrame = function() {
((this.center.x >= this._x-.5 && this.center.x <= this._x+.5)&&(this.center.y >= this._y-5 && this.center.y <= this._y+5)) ? this.onEnterFrame = null : (this.FollowPoint(this.center) , this._alpha+=3);
};
}
drawCircle({x:random(Stage.width), y:random(Stage.height)}, 30+random(70), 0);
onEnterFrame = function () {
(maxRadius(center={x:Math.random()*Stage.width, y:Math.random()*Stage.height}, 400)>3) ? drawCircle(center, maxRadius(center, 400)) : null;
};
Click on a circle to remove and have more smaller circles be generated in it. Refresh the page to get a whole new configuration.
Hope you like it!
-freeskier89