Hey all,
I’m working on building my first game and have hit a roadblock. My game works like this:
- Screen 1 - a welcome screen with a “play button”
- Hitting the play button takes you into the game
- When the player dies, it’s supposed to give you an option to start over, but this is not working. The “game over” text displays, but it just stays there and never actually restarts the game.
function gameOver()
gameOverText = display.newText(“Game Over”, 50, 240, native.systemFontBold, 40)
local function removeGOText()
gameOverText:removeSelf()
end
timer.performWithDelay(2000, removeGOText)
player:removePlayer()
Runtime:removeEventListener(“enterFrame”, runtimeListener)
Runtime:removeEventListener(“accelerometer”, accelerometerCall)
Runtime:removeEventListener(“touch”, touchListener)
loader:removeAllSprites()
localGroup = nil
timer.performWithDelay(2000, startOver)
end
function startOver()
loadLevel()
Runtime:addEventListener(“enterFrame”, runtimeListener)
Runtime:addEventListener(“accelerometer”, accelerometerCall)
Runtime:addEventListener(“touch”, touchListener)
end
Sorry about any formatting issues, I’m copying and pasting. Everything in the game works fine except for this part. Hoping someone can point out where I’ve gone wrong. Thank you 
[import]uid: 125387 topic_id: 22354 reply_id: 322354[/import]
It just stays at the “game over” screen.