Sorry, but I think you guys are going about this completely the wrong way. In my game I’ve got a platform acting as a see-saw - rotating and allowing things to hit it, with no problems.
Your issue is that you’re trying to make the dynamic platform stay in place by using absolute position in the enterFrame event, which has been pointed out in previous threads as working against the physics engine.
What you should do is pivot the platform against a static body using the pivot joint. The static body can’t move and the pivot joint will hold the dynamic body in relative place.
Here’s some code to do that:
[lua]-- enable physics engine
local physics = require(“physics”)
physics.start()
– enable physics engine
require(“physics”)
physics.start()
– create an invisible, static body as the “anchor”
local anchor = display.newCircle( -100, -100, 10 )
physics.addBody( anchor, “static” )
– create and position the dynamic platform
local platform = display.newImage( “platform.png” )
platform.x, platform.y = display.contentCenterX, display.contentCenterY
physics.addBody( platform, “dynamic”, { friction=1, bounce=.2 } )
– create a pivot to join the anchor to the platform
local pivot = physics.newJoint(
“pivot”, – joint type
anchor, platform, – objects to join together
platform.x, platform.y – physics world location to join at
)
– you may want to limit the spinning by ‘damping’ the rotation
platform.angularDamping = 5[/lua]
Now, if you put that into a code sample with, for example, crates dropping to the ground, they should bounce off a rotating platform.
Here’s the docs for a description of how to use the joints:
http://developer.anscamobile.com/content/game-edition-physics-joints#Pivot_joint
Matt. [import]uid: 8271 topic_id: 6677 reply_id: 26751[/import]