嗨,由于某种原因,电晕给了我这个错误:尝试索引全局“backC”(一个零值)
local randomBackC = function()
backC = display.newImage("Cloud"..tostring(math.random(1, 4))..".png")
backC.x = math.random (30, 450); backC.y = -20
physics.addBody( backC, { density=2.9, friction=0.5, bounce=0.7, radius=24 } )
end
timer.performWithDelay( 500, randomBackC, 0 )
end
local function cleanup()
if backC.y >100 then
backC:removeSelf()
end
end
Runtime:addEventListener("enterFrame", cleanup)
关于是什么原因的任何想法?