water
/**
* Copyright lizhi ( http://wonderfl.net/user/lizhi )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/zoUt
*/
package
{
import flash.display.*;
import flash.geom.*;
/**
* ...
* @author lizhi http://game-develop.net/
*/
[SWF(frameRate=60,width=465,height=465)]
public class TestMap extends Sprite
{
public function TestMap()
{
var bmd:BitmapData = new BitmapData(465, 465, false), p:Point = new Point, map:Array = [];
for (var i:int = 0; i < 0xff;i++ )map[i] = int(i / 20) * 20;
addChild(new Bitmap(bmd));
addEventListener("enterFrame", function():void {
p = p.subtract(new Point((mouseX - 465/2) / 30, (mouseY - 465/2) / 30));
bmd.perlinNoise(200, 200, 2, 1, true, true, 7, true, [new Point(p.x, 0), new Point(0, p.y)]);
bmd.paletteMap(bmd, bmd.rect, new Point, map, map, map);
} );
}
}
}