forked from: water

by jmbyh521 forked from water (diff: 1)
...
@author lizhi http://game-develop.net/
♥0 | Line 20 | Modified 2015-12-29 16:48:59 | MIT License
play

ActionScript3 source code

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

// forked from lizhi's water
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);
            } );
        }
        
    }

}