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

mountain 日本画風の山を描く
/**
 * Copyright alprkskn ( http://wonderfl.net/user/alprkskn )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/yb6r
 */

// forked from makc3d's forked from: Japanese Mountain
// 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=400;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+5))/0x50550 ))*50-50);
                    color = color | 0x0000DA;
                    map.fillRect(new Rectangle(i,j-l,1,l),color);
                }
            }
            //map.colorTransform(map.rect, new ColorTransform(1, 1, 1, 1, 0, 0, 0xDA, 0));
        }
    }
}