Hi
I am using the “Stopwatch Timing Class” made by Kyle Coburn ( http://developer.coronalabs.com/code/stopwatch-timing-class ) to help me up with the countDown timer and its really great. However, when the CountDown time becomes 0, it doesn’t stop the game play.
Here’s the CountDown code :
[lua]---------TIMER---------
local stopwatch = require “stopwatch”
local timerText = display.newEmbossedText("", 0, 0, “Therapy”, 30)
timerText.x = 280
timerText.y = 30
local countDown = stopwatch.new(5)
local function onFrame(event)
timerText:setText(countDown:toRemainingString())
end
Runtime:addEventListener(“enterFrame”, onFrame)
--------------------------[/lua]
Here’s the GameOver function code :
[lua]local function GameOver()
iceMaker:StopIce()
gameOverText = display.newText(hudGroup, “Game Over”, 0, 0, “Therapy”, 40)
gameOverText:setReferencePoint(display.CenterReferencePoint)
gameOverText.x = screenHW
gameOverText.y = screenHH
gameOverText:addEventListener(“touch”, RestartHandler)
end[/lua]
Thanks