【发布时间】:2017-04-12 07:31:21
【问题描述】:
我希望对象在碰撞时消失,然后在单击重新启动按钮时再次出现。这是我的代码:)
function touchRestart(event)
if event.phase=="began" then
print('foo')
end
end
restart:addEventListener("touch",touchRestart)
function onLocalCollision(raketa,event)
if event.phase=="began" then
if event.object1.myName=="meteor" and event.object2.myName=="raketa" then
score=score -1
scoreNumber.text = score
restart.isVisible=true
end
end
end
raketa.collision = onLocalCollision
Runtime:addEventListener("collision",raketa)
【问题讨论】: