Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 time/Delay
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
upthescale




PostPosted: 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?
Sponsor
Sponsor
Sponsor
sponsor
Bored




PostPosted: Fri Apr 14, 2006 4:13 pm   Post subject: (No 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.
upthescale




PostPosted: Fri Apr 14, 2006 4:14 pm   Post subject: (No subject)

wud u mind writing the codfe
upthescale




PostPosted: Fri Apr 14, 2006 4:17 pm   Post subject: (No subject)

i got it nevermind
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: