我正在制作一个简单的“breakout”游戏,并且我有重新加载map
的问题。例如:如果我从level1开始,打破一些砖块并丢失,比我再次加载相同的地图。接下来的那个球与同砖我“感动”碰撞时间之前,都会给我一个错误Attempt to remove an object that has already been removed
Corona“尝试移除已被移除的物体”
local map = lime.loadMap("maps/" .. currentLevel .. ".tmx")
local layer = map:getTileLayer("bricks_1")
local visual = lime.createVisual(map)
local physical = lime.buildPhysical(map)
function removeBricks(event)
if event.other.isBrick then
local brick = event.other
transition.to(brick, {time = 20, alpha = 0})
score = score + brick.scoreValue
ScoreNum.text = score
-- remove brick
brick:removeSelf()
brick = nil
...
请写你的错误代码行。 – vovahost