LINE 212 function onCollision(e)
LINE 213 transition.to(gameView, {time = 300, x = -gameView.height, display.remove() gameView= nil
end})
endGame = display.newImage('end_game_background.png', display.contentWidth, display.contentHeight- 300)
transition.to(endGame)
background.isVisible = false
lineGroup.isVisible = false
end
当我尝试运行此代码时,我收到一条错误消息: main.lua line:213:'}'预计在gameView附近
答案 0 :(得分:3)
transition.to(gameView, {time = 300, x = -gameView.height, display.remove() gameView= nil
end})
不正确,请尝试onComplete
或onCancel
,同时使用display.remove(gameView)
代替display.remove()
:
transition.to(gameView, {time = 300, x = -gameView.height, onComplete=function()
display.remove(gameView)
gameView= nil
end})