Wall:setPosition (x,y ) -create box2d physical object local body = world:createBody īody.name = 'ball' print (ball:getX ( ). Wall:beginPath ( ) -we make use (0 0) as center of shape, -thus we have half of width and half of height in each direction
Sorry for a lot of questions, but for me is it really hard to learn without code examples in the documentations.Īnd thank you in advance to be patience and help.ī2.setScale (physicsScale ) local world = b2.World.new ( 0, 10, true ) - for creating objects using shape - as example - bounding walls function wall (x, y, width, height, name ) local wall = Shape.new ( ) -define wall shape What is the difference 2 chapter, and how can I use well them ? 0 = no damping, 1 = critical damping.ī2.createDistanceJointDef(bodyA, bodyB, anchorAx, anchorAy, anchorBx, anchorBy) Do not use a zero or short length.įrequencyHz: (number) The mass-spring-damper frequency in Hertz.ĭampingRatio: (number) The damping ratio. Length: (number) The natural length between the anchor points. LocalAnchorB: (table) The local anchor point relative to bodyB’s origin. LocalAnchorA: (table) The local anchor point relative to bodyA’s origin. This helps when saving and loading a game.īodyA: (b2.Body) The first attached body.īodyB: (b2.Body) The second attached body.ĬollideConnected: (boolean) Set this flag to true if the attached bodies should collide. The definition uses local anchor points so that the initial configuration can violate the constraint slightly. This requires defining an anchor point on both bodies and the non-zero length of the distance joint.
In the reference manual I found 2 groups in manual :ĭistance joint definition.
When I click on the circle why has a strange animation with choppy ?
How can I fix the the distance between 2 objects without enlarge ? How can I set the distance between 2 object? I would learn ad doing that effect in Gideros. I want to doing the examples what I found here, if you click on the photo will ope the live Flash examples. Added the distancejoint, but not work well how I waited, isn't fluid and isn't maintain the distance (it's similar to rope joint, what I would like in the future ).