News:

Building a 3D Ray Tracer  By stevmjon

Main Menu

time-totalizer

Started by ATLUS, May 09, 2009, 08:49:27 AM

Previous topic - Next topic

ATLUS

 ;)
PlayBASIC Code: [Select]
; PROJECT : secundomer
; AUTHOR : ATLUS
; CREATED : 09.05.2009
; EDITED : 09.05.2009
; ---------------------------------------------------------------------

setfps 60
time=timer(); set current time in milisec
LoadFont "Arial",2,40,0
do
cls rgb(0,0,0)
//***********************
ms=timer()-time;set timer

if ms>1000 then s=s+1:time=timer();check seconds

if s>60 then m=m+1:s=s-60;check minits
//************************************
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
if spacekey()=true;;;;;;;;check resultat
pms=ms;;;;;;;;;;;;;;;;;;;;
ps=s;;;;;;;;;;;;;;;;;;;;;;
pm=m;;;;;;;;;;;;;;;;;;;;;;
FlushKeys;;;;;;;;;;;;;;;;;
endif;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
SetFont 2
text 400,300,"timer:" + Str$(m) + "'" + Str$(s) + "'" + Str$(ms)
text 10,10,"score:" + Str$(pm) + "'" + Str$(ps) + "'" + Str$(pms)
sync
loop




kevin

#1
 Perhaps you could tell people what it does ? :)

ATLUS

forgot :) This code shows how to measure time in the game