particle_dot

by t2421
♥0 | Line 36 | Modified 2012-08-26 00:12:44 | MIT License
play

ActionScript3 source code

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

package {
    import flash.geom.ColorTransform;
    import flash.events.Event;
    import flash.display.Bitmap;
    import flash.display.BitmapData;
    import flash.display.Sprite;
    public class Main extends Sprite {
        private const HEIGHT:Number = 465;
        private const WIDTH:Number = 465;
        private var _canvas:BitmapData;
        private var _particle:Particle;
        private var _cavnasBM:Bitmap;
        public function Main() {
            stage.frameRate = 60;
            _canvas = new BitmapData(WIDTH,HEIGHT,false,0x000000);
            _cavnasBM = new Bitmap(_canvas);
            addChild(_cavnasBM);
            _particle = new Particle(100,100);
            _particle.x = 200;
            _particle.y = 200;
            _canvas.setPixel(_particle.x,_particle.y,_particle.color);
        }
        

    }
}

class Particle {
    public var x:Number;
    public var y:Number;
    public var vx:Number = 0;
    public var vy:Number = 0;
    public var color:uint;
    
    public function Particle(x:Number=0,y:Number=0,color:uint=0xfff000){
        this.x = x;
        this.y = y;
        this.color = color;
    }

}

Forked