I basically have a modified 2 minute countdown timer from Peaches timer script. My problem is it keeps counting past 0, when I want the game to end. I know it sounds pretty n00bish but I haven’t found any useful tutorials for this, if it deserves one but I don’t know how to end games!
[code]
local secsText = 0
local minsText = 2
local timeText = display.newText(minsText… “:0” …secsText, 50, 200, “Helvetica”, 24)
timeText:setTextColor(255,255,255)
local function updateTime(event)
secsText = secsText - 1
if secsText < 0 then
secsText = 59
minsText = minsText-1
end
if secsText < 10 then
timeText.text = minsText … “:0” …secsText
else
timeText.text = minsText … “:” …secsText
end
end
timer.performWithDelay(1000, updateTime, 0) [import]uid: 114389 topic_id: 23578 reply_id: 323578[/import]
[import]uid: 21331 topic_id: 23578 reply_id: 94552[/import]