am using this code beloew: but when i run it i can not get it to count down for 30 sec, instead i get like -5945 :S any help would be very grateful
cheers chris
global gEndTime
on startMovie
-- game ends 30 seconds from now
gEndTime = the ticks + 30*60
showTime
end
on showTime
-- convert ticks to seconds remaining
timeLeft = (gEndTime - the ticks + 30)/60
-- use this text
text = "Time:"&&timeLeft
-- if text is different than text displayed
if member("Time").text <> text then
member("Time").text = text
end if
-- time up?
if timeLeft <= 0 then
go to frame "gameover"
end if
end
cheers chris
global gEndTime
on startMovie
-- game ends 30 seconds from now
gEndTime = the ticks + 30*60
showTime
end
on showTime
-- convert ticks to seconds remaining
timeLeft = (gEndTime - the ticks + 30)/60
-- use this text
text = "Time:"&&timeLeft
-- if text is different than text displayed
if member("Time").text <> text then
member("Time").text = text
end if
-- time up?
if timeLeft <= 0 then
go to frame "gameover"
end if
end