Computer Science Canada

time/Delay

Author:  upthescale [ Fri Apr 14, 2006 4:06 pm ]
Post subject:  time/Delay

i am making a game so i got a 500 second time limit.

code:

var timer:int:=500


when i want the time to decrease

code:

timer-=1


o want the time to go ncie and slow so it's like a clock, but it goes extemely fast because there isn o delay...but if i add a delay, it will slow everything else down that isi n the same loop. So how do i just make the timer go down 1 second, but not everything at the same tyime?

Author:  Bored [ Fri Apr 14, 2006 4:13 pm ]
Post subject: 

use Time.Elapsed. it gives you the number of milisecond the program has been running. Subtract the time from the start of the program to when it start running (if any) then divide your answer by 1000 to get the number of seconds.

Author:  upthescale [ Fri Apr 14, 2006 4:14 pm ]
Post subject: 

wud u mind writing the codfe

Author:  upthescale [ Fri Apr 14, 2006 4:17 pm ]
Post subject: 

i got it nevermind


: