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

Username:   Password: 
 RegisterRegister   
 keeping track of time for a turn based game?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
threatbinder




PostPosted: Thu Dec 17, 2009 8:32 pm   Post subject: keeping track of time for a turn based game?

Time.Elapsed is since the program is run, so how could I do a per turn timer, make it reset every turn back to a certain number in seconds? I tried looking at all the time functions, and they're all pretty useless.. why do we need to know the amount of seconds since 1970? lol
Sponsor
Sponsor
Sponsor
sponsor
apomb




PostPosted: Thu Dec 17, 2009 9:09 pm   Post subject: RE:keeping track of time for a turn based game?

possibly take a look at Time.Delaysincelast in conjunction with Time.Elapsed will allow a process to take a certain amount of time, instead of simply delay() which could be different on different machines.
Tony




PostPosted: Thu Dec 17, 2009 10:33 pm   Post subject: Re: keeping track of time for a turn based game?

threatbinder @ Thu Dec 17, 2009 8:32 pm wrote:
why do we need to know the amount of seconds since 1970? lol

The Universe started on January 1st, 1970. Anyone to says they are over 39 years old is lying about their age.

http://xkcd.com/376/
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
mirhagk




PostPosted: Fri Dec 18, 2009 12:43 am   Post subject: RE:keeping track of time for a turn based game?

k so at the beginning of the turn you record the time in a variable, let's call it t. then the amount of time the turn is taking is Time.Elapsed-t
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: