In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

forked from: forked from: Binary Squares

Binary Squares
And now for something completely different...
Get Adobe Flash player
by makc3d 09 Oct 2011
  • Forked from makc3d's forked from: Binary Squares
  • Diff: 16
  • Related works: 4
  • Talk

    wh0 at 10 Oct 2011 00:02
    1. press down mouse button 2. drag right, past edge of stage 3. cool stuff happens
    makc3d at 10 Oct 2011 02:06
    holding mouse down has no effect for me. what do you see? mouse coordinates beyond 465?
    wh0 at 10 Oct 2011 10:48
    yeah
    yonatan at 10 Oct 2011 11:03
    same here (mouseX goes past 465)
    Embed
/**
 * Copyright makc3d ( http://wonderfl.net/user/makc3d )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/7e2e
 */

// forked from makc3d's forked from: Binary Squares
// forked from Aquioux's Binary Squares
package {
    import flash.display.Sprite;
    [SWF(width = "512", height = "512", frameRate = "30", backgroundColor = "#FFFFFF")]
    /**
     * Binary Squares
     * And now for something completely different...
     */
    public class Main extends Sprite {
        public function Main():void {
            addEventListener ("enterFrame", loop);
        }
        private function loop (e:*):void {
            var sw:int = stage.stageWidth;
            var sh:int = stage.stageHeight;
			var w2:Number = sw / 2;
			graphics.clear();
            graphics.beginFill (0);
			rec (w2, w2, w2, 0.45 * mouseX / 465);
		}
		public function rec (atx:Number, aty:Number, w:Number, k:Number):void {
			if (w > 1) {
				var w2:Number = w / 2
				graphics.drawRect (atx - w2, aty - w2, w, w);
				rec (atx - w2, aty - w2, w*k, k);
				rec (atx - w2, aty + w2, w*k, k);
				rec (atx + w2, aty + w2, w*k, k);
				rec (atx + w2, aty - w2, w*k, k);
			}
		}
    }
}