Sea
海を描く。17行のコード。
/**
* 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);
}
}
}