forked from: flash on 2010-2-11

by Tamanegi_kenshi forked from flash on 2010-2-11 (diff: 80)
♥0 | Line 28 | Modified 2010-09-01 01:14:27 | MIT License
play

ActionScript3 source code

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

// forked from azzip's flash on 2010-2-11
package 
{
    import flash.events.*;
    import flash.display.*;
    import com.actionsnippet.qbox.*;
    import com.actionsnippet.qbox.QuickObject;
    
    
    public class Test extends MovieClip
    { 
        private var test:QuickBox2D;
      //  private var box:QuickObject;
    
        public function Test()
        {
            stage.frameRate = 60;
            
            test = new QuickBox2D(this, { debug:true } );

            //test.createStageWalls();
           
            
           
        //    test.addCircle( { x:5, y:4, radius:3 } );
            test.addBox( { x:8, y:14, width:2, height:1, density:0 } ); 
            test.addBox( { x:7, y:13, width:1, height:2, density:0} );
            test.addBox( { x:9, y:13, width:1, height:2, density:0} );
           
           // box = test.addBox( { x:10, y:10, width:2, height:2} );
            
            test.start();
            test.mouseDrag();
            
            //stage.addEventListener(MouseEvent.CLICK, onClick);
            addEventListener(Event.ENTER_FRAME, onEnter);    
        }
        private function onClick(e:MouseEvent):void{
         //   box = test.removeBox();
         test.addCircle( { x:8, y:1, radius:Math.floor(Math.random() * 5) } );
        }
        private function onEnter(e:Event):void{
            test.addCircle( { x:Math.random() * 0.1 +8, y:1, radius:0.1 } );
        }

               
    }
    
}