How many times did you need a timer and couldn't bake one yourself? Your problems are over!
I'll explain how the thing work and I bet anyone shall understand:
Right before the game loop starts, you shall do the following:
started = timer()
This will record the moment your level started.
If you need to set up a time limit, you do this:
time_limit = seconds * 1000 where seconds are obviously the amount of time you want to set up in... seconds.
To call whatever you wish to happen when time is over, just do this:
IF timer() >= started + time_limit THEN...
Got it?
Here's a little example:
do
cls
input "Amount of seconds:",seconds
time_limit = seconds*1000
started = timer()
repeat
print (( (started + time_limit)-timer() )/1000), " seconds remaining"
until timer() > started + time_limit
print "Time over!"
repeat : until spacekey() = 1
loop
Hope someone find it useful.
[size=+2]Forever and one[/size]