Moving Perlinnoise

by Thumas
♥0 | Line 30 | Modified 2011-12-18 05:32:17 | MIT License
play

ActionScript3 source code

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

package {
    import flash.display.BitmapData;
    import flash.display.Bitmap;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.geom.Point
    public class FlashTest extends Sprite{
        
        public var b:BitmapData
        public var bit:Bitmap;
        
        private var i:uint
        private var points:Array
        
        public function FlashTest() {
            b = new BitmapData(500,500,true,0);
            
            points = []
            
            points.push(new Point);
            points.push(new Point);
            
            bit = new Bitmap(b);
            addChild(bit);
            this.addEventListener(Event.ENTER_FRAME,update);
        }
        
        private function update(e:Event):void{
            i++;
            points[0].x = i
            points[0].y = i
            points[1].x = i
            points[1].x = i
            b.perlinNoise(50,50,10,10,true,true,1|2,true,points);
        }

    }
}