CLICK HERE TO COPY
Actionscript:
import com.actionsnippet.qbox.*;
import Box2D.Dynamics.Joints.*;
[SWF (backgroundColor=0x222222, width=700, height=600)]
var sim:QuickBox2D = new QuickBox2D(this);
sim.setDefault({fillColor:0x000000, lineColor:0xCCCCCC});
sim.createStageWalls();
var legA:QuickObject = sim.addBox({x:5, y:11, width:2, height:0.2,groupIndex:-2});
var three:QuickObject = sim.addBox({x:6.8 + 1.8, y:11, width:2, height:0.2,groupIndex:-2});
var legB:QuickObject = sim.addBox({x:6.8, y:11, width:2, height:0.5,groupIndex:-2});
sim.setDefault({type:"revolute"});
var anchorX:Number = legA.x + (legB.x - legA.x) / 2;
var anchorY:Number = legA.y;
var revJointA:QuickObject = sim.addJoint({a:legA.body, b:legB.body, x1:anchorX, y1:anchorY,enableMotor:true, maxMotorTorque:80});
anchorX = legB.x [...]