Sea

by shohei909
海を描く。17行のコード。
♥14 | Line 17 | Modified 2010-09-25 16:06:51 | MIT License
play

ActionScript3 source code

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

//海を描く。17行のコード。

package {
    import flash.geom.*;
    import flash.display.*;
    [SWF(backgroundColor="0x1122FF")]
    public class Cloud extends Sprite {
        private var arr:Array = [ new Point(0,0), new Point(0,0), new Point(0,0)]
        private var sea:BitmapData = new BitmapData( 465,265,true );
        function Cloud() {
            addChild( new Bitmap(sea) ).y = 200;
            addEventListener( "enterFrame", onFrame);
        }
        private function onFrame(e:*):void{
            for(var i:int=0;i<3;i++) arr[i].x += (((i*3) % 4) - 2);
            sea.perlinNoise(256,64,3,0,true,false,8,false,arr);
        }
    }
}

Forked