The problem im having is when GameOver happens and the button apears for new screen the process (game) still runs and when I click new game (new scene to same game) it doubles up on top of the old game lol… is there a simple function to force a restart/reload using this method??
thanks in advance for your time…
top of main.lua [lua]module(…, package.seeall)
– Main function - MUST return a display.newGroup()
function new()
local localGroup = display.newGroup()[/lua]
game code here (not posted)
game over…
[lua]function gameOver()
local overSplash = display.newImage( “game_over.png”, true )
overSplash.alpha = 0
overSplash.xScale = 1.5; overSplash.yScale = 1.5
local showGameOver = transition.to( overSplash, { alpha=1.0, xScale=1.0, yScale=1.0, time=500 } )
local bt01 = display.newImage(“bt_button.png”)
local function bt01t ( event )
if event.phase == “ended” then
director:changeScene(“game”,“button”)
end
end
bt01:addEventListener(“touch”,bt01t)
bt01.x = 100
bt01.y = 300
localGroup:insert(bt01)
cueball:removeEventListener( “touch”, cueShot )
end
cueball:addEventListener( “touch”, cueShot )
return localGroup
end [/lua]
[import]uid: 13743 topic_id: 5525 reply_id: 305525[/import]