I have this code, maybe its cause my problem that when I replay my game sometimes my screen got froze.
how can I cancel the Timer and Translate when I want to go to another screen (( game Over ))
[code]
local background = display.newImage(“images/bgscreen3.png”)
local background2 = display.newImage(“images/bgscreen32.png”)
l
local tPrevious = system.getTimer()
function move(event)
local tDelta = event.time - tPrevious
tPrevious = event.time
local xOffset = ( 0.2 * tDelta )
background.x = background.x - xOffset
background2.x = background2.x - xOffset
if (background.x + background.contentWidth) < 0 then
background:translate( 480 * 2, 0)
end
if (background2.x + background2.contentWidth) < 0 then
background2:translate( 480 * 2, 0)
end
end
[/code] [import]uid: 13061 topic_id: 8417 reply_id: 308417[/import]