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: Japanese Mountain

mountain 日本画風の山を描く
Get Adobe Flash player
by makc3d 20 Mar 2012
/**
 * Copyright makc3d ( http://wonderfl.net/user/makc3d )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/nIMH6
 */

// forked from shohei909's Japanese Mountain
// forked from shohei909's Mountain
//mountain 日本画風の山を描く


package {
    import flash.display.*;
    import mx.utils.ColorUtil;
    import flash.geom.*;
    public class FlashTest extends Sprite {
        public var map:BitmapData;
        public function FlashTest() {
            map =  new BitmapData(465,701,false,0x000000);
            addChild( new Bitmap(map) );
            stage.addEventListener ("click", onClick);
            onClick();
        }
        public function onClick(e:*=null):void {
            map.perlinNoise(256,256,7,Math.random()*100,false,true,4,true);
            for(var i:int=0;i<465;i++){
                for(var j:int=300;j<700;j++){
                    var l:uint = map.getPixel(i,j)/0x010101;
                    var color:uint = ColorUtil.adjustBrightness2(0xDDDDDD, Math.sin(Math.atan( (map.getPixel(i,j)-map.getPixel(i,j+20))/0x50000 ))*50-50);
                    map.fillRect(new Rectangle(i,j-l,1,l),color);
                }
            }
        }
    }
}