I have a seesaw in my game. I create a small circle object (just because) and make it a static physics object. I then create a larger dynamic rectangle object over the top of it. What makes it a rotating rectangle which can either be moved by other objects or kick them object (when under its own force) is the pivot joint placed at the centre of the circle object. The following code is off the top of my head as I’m at work (without mac) but should give a good indication…
[lua]local circle = display.newCircle( 100,100, 5 )
local rect = display.newRect( 0,0 , 100,10 )
rect.x, rect.y = circle.x, circle.y – also colour the rect here
physics.addBody( circle, “static”, {friction=0, bounce=0, density=0 } )
physics.addBody( rect, “dynamic”, {friction=1, bounce=.2, density=1 } )
physics.newJoint( “pivot”, circle, rect, circle.x, circle.y )[/lua]
matt. [import]uid: 8271 topic_id: 4841 reply_id: 15600[/import]