我试图在碰撞时将我的一个物理体移动到不同的 xAxis
local function onCollision(self,event)
if event.other.name == "block" then
if (event.other.x - self.x) > 210 then
self:removeSelf()
self = nil
transition.cancel( event.other.move )
event.other:removeSelf()
event.other = nil
gameOver()
else
print("else")
transition.cancel( event.other.move )
event.other.x = 1024
updateScore(1)
end
end
end
ball.collision = onCollision
ball("collision",ball)
但它是说
"Cannot translate an object before collision is resolved"
我怎样才能做到这一点 ?