如何在Corona SDK中将对象隐藏在预碰撞事件状态下?

我需要在预碰撞事件中隐藏对象,这是我尝试的代码。

-- 删除事件侦听器
function bird:preCollision(event)
    local platform = event.other
    if platform.myName == "object" then
        scoreText.text = scoreText.text + 1;
        obejct.isVisible = false;
    end
end
bird:addEventListener("preCollision")
点赞
用户869951
用户869951

应该是platform.isVisible而不是object.isVisible

注:你不需要分号,那个注释是错的。

2014-02-09 05:08:48