2
嘿,我正在使用此代碼來移動(動畫)我的對象在場景 但它泄漏內存並停止響應。如何在corona sdk中移動物體?
//transition back
local function goBack()
transition.to (wall2, { time = 10000, x = 100, y = 310, onComplete = startTransition})
transition.to (wall, { time = 10000, x = 700, y = 200, onComplete = startTransition})
transition.to (gate_a, { time = 10000, x = 100, y = 255, onComplete = startTransition})
transition.to (stargate_a, { time = 10000, x = 100, y = 255, onComplete = startTransition})
end
//transition start
function startTransition()
transition.to (wall2, { time = 10000, x = 700, y = 310, onComplete = goBack})
transition.to (wall, { time = 10000, x = 100, y = 200, onComplete = goBack})
transition.to (gate_a, { time = 10000, x = 700, y = 255, onComplete = goBack})
transition.to (stargate_a, { time =10000, x = 700, y = 255, onComplete = goBack})
end
startTransition()
如何正確移動對象而不會泄漏任何內存?