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

Username:   Password: 
 RegisterRegister   
 Timer
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
DJ




PostPosted: Sat Jun 28, 2003 1:21 pm   Post subject: Timer

I want to put a timer in my game, and have it start when a player pushes start game or something
the object of the game is to stay alive the longest, and i dont want to use a points system.

thanks, DJ
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sat Jun 28, 2003 2:04 pm   Post subject: (No subject)

you could use clock() or wallclock()

clock() says how much time has passed since beginning of the program in milliseconds.

wallclock() is your system time, says how much seconds passed since Jan 1st, 1970.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
naoki




PostPosted: Sat Jun 28, 2003 11:21 pm   Post subject: (No subject)

yah. use clock, and when u die put the current time to a textfile
then just merely check if it's greater for a high score
SilverSprite




PostPosted: Sat Jun 28, 2003 11:27 pm   Post subject: (No subject)

whats this? naoki becoming quite the computer whiz
Andy




PostPosted: Sun Jun 29, 2003 1:38 pm   Post subject: (No subject)

yepp naoki is the smart...
DJ




PostPosted: Sun Jun 29, 2003 3:21 pm   Post subject: (No subject)

code:
process timer
    var timer2 : int
    timer2 := 0
    clock (timer2)
    locate (1, 1)
    put timer2 / 1000 : 0 : 2, " seconds"
end timer


this is what i used and it worked!
naoki




PostPosted: Sun Jun 29, 2003 3:34 pm   Post subject: (No subject)

you'll prolly need a delay after the put statement
and u dun need 2 initialize the variable (even a little helps)

....... since i'm dense to sarcasm, i'll assume those were compliments
Andy




PostPosted: Mon Jun 30, 2003 8:22 am   Post subject: (No subject)

they were, we were just suprised that u'd help...
naoki




PostPosted: Mon Jun 30, 2003 1:25 pm   Post subject: (No subject)

nah this stuff is child's play. i gotta start going hardkore Turing learning so i can argue w/ every1 about raycasting and that stuff
Andy




PostPosted: Tue Jul 01, 2003 7:30 am   Post subject: (No subject)

hardcore turing? ahahahaha this is not extreme beach volley ball u know... even though crono made a crappier version of it
krishon




PostPosted: Tue Jul 01, 2003 4:26 pm   Post subject: (No subject)

lol....dun't go hardcore turing....how bout c++?? at least u won't get made fun of by goin hardcore turing
Andy




PostPosted: Tue Jul 01, 2003 5:41 pm   Post subject: (No subject)

ya hardcore turing tells others that uran amature..
SilverSprite




PostPosted: Tue Jul 01, 2003 6:05 pm   Post subject: (No subject)

you must be some amateur then.. especially since you dont know how to spell amateur
Andy




PostPosted: Tue Jul 01, 2003 6:07 pm   Post subject: (No subject)

shut up silversprite, who cares about spelling on this site look at dan *points to dan in the conner with the book of typos*
naoki




PostPosted: Tue Jul 01, 2003 10:14 pm   Post subject: (No subject)

dan has typos
dan is mod
dan can ban dodge
dan can ban dodge
dan can ban dodge

oops, did i repeat the last one too much? Razz
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 2  [ 19 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: