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

water

Get Adobe Flash player
by lizhi 02 Dec 2012
/**
 * 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);
			} );
		}
		
	}

}