Chaotic filling
Just something completely random I encountered while playing around with drawing shapes. Add a few lines of code…
var n = 0, r = 0;;
addEventListener(Event.ENTER_FRAME, OnEnterFrame);
function OnEnterFrame(event:Event):void {
n +=1, r += 1;
var NumberOfPolygons = n%360;
this.graphics.clear();
this.graphics.beginFill(0xFFFFFF – n * NumberOfPolygons, 1);
this.graphics.moveTo(250 + r * Math.sin(n*Math.PI/180), 250 + r * Math.cos(n*Math.PI/180));
for (var i = 0; i < NumberOfPolygons + 1; i++) {
n += Math.floor(NumberOfPolygons*0.5) / NumberOfPolygons * 360;
this.graphics.lineTo(250 + r * Math.sin(n*Math.PI/180), 250 + r * Math.cos(n*Math.PI/180));
}
this.graphics.endFill();
}
And we got ourselves a nice ol' insane flash animation.
Categories and tags of the game : Demonstration, Epilepsy Warning, Single Player