Testing QuickBox2D
/**
* Copyright shapevent ( http://wonderfl.net/user/shapevent )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/5PTV
*/
package {
import flash.display.*;
[SWF(backgroundColor=0x111144)]
public class Qb2D extends MovieClip {
import com.actionsnippet.qbox.*;
import Box2D.Common.Math.*;
private var sim:QuickBox2D;
public function Qb2D() {
sim = new QuickBox2D(this);
sim.setDefault({fillColor:0,
fillAlpha:0.4,
lineColor:0x666666});
sim.createStageWalls();
for(var i:int = 0; i<10; i++){
sim.addBox({x:3, y:3+i});
}
var c:QuickObject= sim.addCircle({x:8, y:2,
density:5});
c.body.SetLinearVelocity(new b2Vec2(5, 0));
sim.addBox({x:13, y:5, width:0.2, height:3});
sim.addBox({x:10, y:5,
width:6,
height:0.25,
angle:0.1,
density:0});
sim.addBox({x:10.8, y:8,
width:9,
height:0.25,
angle:-0.2,
density:0});
sim.start();
sim.mouseDrag();
}
}
}