【发布时间】:2014-08-12 13:58:42
【问题描述】:
我正在使用 Corona SDK 来检测碰撞。使用以下代码检测碰撞是在正方形的左侧还是右侧,我没有问题:
if (event.other.x < displayObj.x)
碰撞代码:
function box:collision(event)
if event.phase == "ended" then
if event.other.id and event.other.id == "c" then
--need to detect top collision
test = 1
end
如何检测方块顶部是否与某物发生碰撞?
【问题讨论】:
-
向我们展示您对
function onCollision(event)的实现。现在我不明白你为什么不能使用.y。 -
把它放在你的问题中!
标签: lua coronasdk collision-detection