TIMERS FOR GAMES!!!
Author |
Message |
nate
|
Posted: Fri Mar 28, 2003 5:36 pm Post subject: TIMERS FOR GAMES!!! |
|
|
I am making this Sniper game and I want to have a timer so that if you do not kill the person in a certain amount of time you will lose or something but I was wondering if anyone could give my the code for a TIMER
Also If anyone can give me good Ideas that would impress my teacher that would be greatly appreciated
Thanks
-Nate
MOD EDIT: Moved to turing help |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Asok
|
Posted: Fri Mar 28, 2003 6:18 pm Post subject: (No subject) |
|
|
you can check usage in the Turing help file. |
|
|
|
|
|
Dan
|
Posted: Fri Mar 28, 2003 6:27 pm Post subject: (No subject) |
|
|
there are a few difrent ways you could do this.
the simpisted being, puting a couter in a loop.
but if you whont to use real time then i whod use the time comands
ex.
code: |
var oldtime:int := Time.Sec
loop
locatexy(maxx div 2, maxy div 2)
put Time.Sec - oldtime
end loop
|
|
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
|
haujobb
|
Posted: Mon Mar 31, 2003 9:00 pm Post subject: (No subject) |
|
|
you would have to put it in a process:
var time : int := 30
process countDown ()
delay(1000)
time := time - 1
end countDown
then:
fork countDown ()
you might have to include time as an argument, im to lazy to remember.... |
|
|
|
|
|
azndragon
|
Posted: Mon Mar 31, 2003 11:16 pm Post subject: (No subject) |
|
|
If you wanted to include the timer as an arguement, use this:
code: | process timer (seconds : int)
delay (seconds * 1000)
cls
put "Bye"
end timer
fork timer(2)
put "Hi" |
That just displays hi, and after 2 seconds, displays bye. |
|
|
|
|
|
|
|