round objects are getting stuck to the sides of walls indefinitely, with no way to ‘unstick’ them. this happens on the shapetumbler demo application as well (try getting the soccer ball in a corner). this pretty much kills the game dynamic of our game, and I can’t find a fix aside from some crafty collision handler. any advice would be much appreciated!
btw, i added a bunch of other lines to see if it was friction or anything, but even removing the horizontal obj platforms, the ball still gets stuck.
[code]
local physics = require “physics”
physics.setScale(60)
physics.start()
physics.setGravity(0, 9.8) – initial gravity points downwards
physics.setDrawMode( “hybrid” )
system.setAccelerometerInterval(99) – set accelerometer to maximum responsiveness
function onTilt( event )
physics.setGravity( (9.8 * event.xGravity ), 9.8)
end
Runtime:addEventListener( “accelerometer”, onTilt )
bodies = {}
borderBodyElement = {friction = 0.3, bounce = 0.3}
table.insert(bodies, display.newRect(0, 0, 320, 20))
table.insert(bodies, display.newRect(0, 460, 320, 20))
table.insert(bodies, display.newRect(0, 20, 20, 460))
table.insert(bodies, display.newRect(300, 20, 20, 460))
local obj = display.newRect(0, 100, 230, 10)
obj:rotate(10)
table.insert(bodies, obj)
obj = display.newRect(90, 200, 230, 10)
table.insert(bodies, obj)
obj = display.newRect(0, 340, 230, 10)
table.insert(bodies, obj)
obj:rotate(-5)
for i=1, #bodies do
physics.addBody(bodies[i], “static”, borderBodyElement)
end
ball = display.newCircle(200, 200, 25);
ball.x = 60
ball.y = 30
ball:setFillColor(120, 50, 50, 255)
physics.addBody(ball, “dynamic”, {friction = 0.4, bounce = 0.3, radius = 23})
[/code] [import]uid: 8791 topic_id: 3157 reply_id: 303157[/import]