Function 在Corona SDK中,为什么此函数返回错误?
当我尝试运行此代码时,我得到一个错误,上面写着: main.lua行:213:“}”应在gameView附近Function 在Corona SDK中,为什么此函数返回错误?,function,lua,coronasdk,Function,Lua,Coronasdk,当我尝试运行此代码时,我得到一个错误,上面写着: main.lua行:213:“}”应在gameView附近 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_b
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
不正确,请尝试onComplete或onCancel,同时使用display.removegameView而不是display.remove:
真是一团糟,请尝试改进代码的格式。为什么有一个end},它与什么配对?请格式化您的代码。我们的社区是一群愿意帮助的志愿者。至少要尊重他们的承诺,以一种令人满意的方式提出你的问题。你的意思是要让他们在场吗?看起来像是复制粘贴错误,也许?正确的格式也会帮助您了解您正在做什么。。。
transition.to(gameView, {time = 300, x = -gameView.height, display.remove() gameView= nil
end})
transition.to(gameView, {time = 300, x = -gameView.height, onComplete=function()
display.remove(gameView)
gameView= nil
end})