Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / timer question

Author
Message
James Bond
20
Years of Service
User Offline
Joined: 20th Jul 2004
Location:
Posted: 27th Jul 2004 16:54
i want to set a timer which is displayed on the top of the screen .... but i can'tttttttttttttttt here is the code which i tried to create!! ... kindly repair it for me

sync on
sync rate 60
hide mouse
for x = 1 to 10
make object cube x,100
position object x,rnd(2000),0,rnd(2000)
next x


`edited for testing
`load object "c:\cube.x",1
make object cube 11,10
timenum = 1

do
set cursor 100,100
cls
print timenum
timenum = timenum + 1
wait 1000
if rightkey()=1
y=wrapvalue(y+1)
`angley#=wrapvalue(angley#+5.0)
endif


if leftkey()=1
y=wrapvalue(y-1)
`angley#=wrapvalue(angley#-5.0)
endif

if upkey()=1
move object 11,10
endif

if downkey()=1
move object 11,-10
endif

`rotate both camera and object
yrotate object 11,y
yrotate camera y

` make the camera to follow the object in a circular manner
position camera object position x(11)-(sin(object angle y(11))*30),object position y(11)+10,object position z(11)-((cos(object angle y(11)))*30)
xrotate camera 2


sync
loop
dance dreemer
22
Years of Service
User Offline
Joined: 24th Jan 2003
Location: cyber space
Posted: 28th Jul 2004 01:22
not sure if this is exactly what you wanted but fixed the code above

if tired()=1 then goto bed
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 28th Jul 2004 03:14 Edited at: 28th Jul 2004 03:16
this?

start_time=timer()
set text opaque
do
rem move all objects etc
seconds=int(timer()-start_time)
text 0,0,str$(seconds)
sync
loop

or this?

set text opaque
do
rem move stuff here
text 0,0,get time$()
sync
loop

any good?

Mentor.

PC1: P4 hyperthreading 3ghz, 1gig mem, 2x160gig hd`s, Nvidia FX5900 gfx, 6 way surround sound, PC2: AMD 1.2ghz, 512mb ram, FX5200 ultra gfx, stereo 16 bit soundblaster.

Login to post a reply

Server time is: 2025-05-25 03:48:23
Your offset time is: 2025-05-25 03:48:23