NOTE: Dont even bother with this code. The seconds needed to be 5 instead of 6. The line .. if tclock<=timer()-6000 should be
if tclock<=timer()-5000 . So if you still want to use it, make this change.
This makes a 24 hour gameclock. Military time. It puts a graphical clock in the upper right of your screen. Be aware that the minutes are 6 seconds long. One day is equal to 2 real hours. This is great for most MMORPG's. With a little tweaking you can set it for anytime.
First, get yourself some number bitmaps 0 to 9. Make sure their about 16 pixels in width and in .bmp format. Put them in a folder called "numb". And make sure that folder is in the same folder as your exe file or whatever. I dont know why Im explaining so much. If your reading this you''ll get it right away
rem *********************
rem Gameclock
rem By Maxillian
rem May 25th 2003
rem *********************
set display mode 800,600,16
hide mouse : sync rate 40 : cls rgb(1,1,1)
center text screen width()/2,screen height()/2,"Loading..."
sleep 2000 : cls rgb(1,1,1) : show mouse
rem load gameclock numbers
for number=0 to 9
load image "numb"+str$(number)+".bmp",1000+number
next number
tclock=timer()
ttclock=0
rem Mainloop
do
gosub _gameclock
loop
_gameclock:
if tclock<=timer()-6000 then ttclock=ttclock+1 : tclock=timer() : gosub _clockcycle
_clockcycle:
time$=str$(ttclock) : timec=len(time$) : for timeb=1 to timec
timep$=mid$(time$,timeb) : timed=val(timep$)
if ttclock=2400 then ttclock=0
if ttclock=60 then ttclock=100
if timec>2 then timeri$=right$(time$,2)
if timec=3 then timele$=left$(time$,1)
if timec=4 then timele$=left$(time$,2)
timeri=val(timeri$) : timele=val(timele$)
if timeri=60 then ttclock=timele*100+100
if timec=1 then paste image 1000,726,7 : paste image 1000,742,7 : paste image 1000,758,7 : paste image 1000+timed,758+(timeb*16),7
if timec=2 then paste image 1000,726,7 : paste image 1000,742,7 : paste image 1000+timed,742+(timeb*16),7
if timec=3 then paste image 1000,726,7 : paste image 1000+timed,726+(timeb*16),7
if timec=4 then paste image 1000+timed,710+(timeb*16),7
next timeb
return
return
Have fun.
*** Maxillian Software ***