I’m totally baffled here.
I’ve got a timer that keeps spawning monsters as long as there are monsters left in an array to spawn.
Obviously, if the player pauses the game, I want this timer to pause. Pausing physics was cake, but now that I’ve come back around to cleaning some stuff up… I can’t get the timer to pause/resume?
Basically in the onTouch for the pause button this happens:
if gameIsActive then
gameIsActive = false
if monsterTimer then timer.pause(monsterTimer); end
physics.pause()
else
gameIsActive = true
physics.start()
--resume everything
if monsterTimer then
print("resuming monster timer")
timer.resume(monsterTimer)
end
end
There are a lot of other timers that I’m also attempting to pause, but NONE of them work. As you can imagine, all hell breaks loose when you unpause the game… and a lot of unexpected behavior.
I added the print to make sure that it was being called (and it is) but it doesn’t seem to do ANYTHING. Nothing. It just stops spawning monsters.
The timer.pause definitely works because I don’t end up with a screen full of monsters (like I used to) when I unpause the game… but resume seems busted.
I haven’t read anyone with problems with this, so I’m at a complete loss. Would love some help! [import]uid: 37122 topic_id: 16877 reply_id: 316877[/import]
[import]uid: 52491 topic_id: 16877 reply_id: 63705[/import]