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

flash on 2012-11-14

Get Adobe Flash player
by hucota7 15 Nov 2012
    Embed
/**
 * Copyright hucota7 ( http://wonderfl.net/user/hucota7 )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/d6QT
 */

package {
    import flash.display.Sprite;
    public class FlashTest extends Sprite {
        public function FlashTest() {
            //EDITABLE VARS
            var mazeSize:int = 69; // Keep odd
            var mazeScale:int = 6;
            //////////////////////////////////
            //VARIABLES
            //var wallArray:Array = new Array();
            //////////////////////////////////
            //SETUP
            
            for (var i:int = 0; i < mazeSize; i++)
            {
                for (var j:int = 0; j < mazeSize; j++)
                {
                    //wallArray.push([]);
                    if ( (i == 0 || j == 0 || i == mazeSize-1 || j == mazeSize-1) ||
                    ( i % 2 == 0 && j % 2 == 0 ) ||
                    ( int( Math.random()*2 ) == 0 && ( i % 2 == 0 || j % 2 == 0 ) ) )
                    {
                        var wall:Sprite = new Sprite();
                        wall.graphics.beginFill(0x000000);
                        wall.graphics.drawRect(0,0,mazeScale,mazeScale);
                        wall.graphics.endFill();
                        wall.x = i*mazeScale;
                        wall.y = j*mazeScale;
                        addChild(wall);
                        //wallArray[i][j] = 1;
                    }
                    else
                    {
                        //wallArray[i][j] = 0;
                    }

                }
            }

        }
    }
}