Tree Base

by _wonder
♥0 | Line 29 | Modified 2010-06-18 18:52:01 | MIT License
play

ActionScript3 source code

/**
 * Copyright _wonder ( http://wonderfl.net/user/_wonder )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/j8vI
 */

package {
    import flash.display.Sprite;
    
    [SWF(backgroundColor=0x000000)]
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // write as3 code here..
            var tree:Tree = new Tree();
            tree.x = stage.stageWidth / 2;
            tree.y = stage.stageHeight / 2;
            addChild( tree );
        }
    }
}

import flash.display.Sprite;

class Tree extends Sprite {
	public var xpos:Number = 0;
	public var ypos:Number = 0;
	public var zpos:Number = 0;
	
	public function Tree(){
		init();
	}
	
	private function init():void {
		graphics.lineStyle( 0, 0xffffff );
		graphics.lineTo( 0, -140 - Math.random() * 20 );
		graphics.moveTo( 0, -30 - Math.random() * 30 );
		graphics.lineTo( Math.random() * 80 - 40, -100 - Math.random() * 40 );
		graphics.moveTo( 0, -60 - Math.random() * 40 );
		graphics.lineTo( Math.random() * 60 - 30, -110 - Math.random() * 20 );
	}
}

Forked