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 / another one

Author
Message
Jigga
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location:
Posted: 23rd Nov 2002 02:29
Yes, I am still fairly new to dark basic. In my program, I want to have a game timer. That is, I want the number 300
printed to the screen at start up. Then every second, the number 300 goes to 299, 298, 297 and so on. I have figured out how to do this in my program, but there is a problem. It seems like the number blinks on and off instead of just changing every second. How do I do this?
xtom
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Ireland
Posted: 23rd Nov 2002 03:42
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 23rd Nov 2002 05:35
You have to CLS after you set the cursor or else your numbers will overlap. Try this-


RPGamer

Upcoming RPG: Eternal Destiny : Help Wanted!
Http://halbrosproductions.netfirms.com
Jigga
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location:
Posted: 23rd Nov 2002 17:06
Okay, this is cool, but I want this to work in a 3d game. How do you do this? This is my code. When I run the project, all I see is the numbers, not the sphere. I want the player to be able to see the sphere also.

rem my timer code
sync on
sync rate 30
make object sphere 1,30
a=10
t=timer()
do

set cursor 0,0
`gotta CLS right here or your digits overlap
cls
print a
if timer()-t>1000
dec a
t=timer()
endif

if upkey()=1 then move object 1, +2

if a<0 or a=0 then end
sync
loop

TheNVS
21
Years of Service
User Offline
Joined: 25th Oct 2002
Location: United States
Posted: 23rd Nov 2002 17:15
replace your code with this. i am sure this would work. RPGgamer, nice code.



Jigga
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location:
Posted: 23rd Nov 2002 19:59
Thanks, now it works.

John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 23rd Nov 2002 20:36
Ditto NVS

Upcoming RPG: Eternal Destiny : Help Wanted!
Http://halbrosproductions.netfirms.com

Login to post a reply

Server time is: 2024-03-29 08:40:40
Your offset time is: 2024-03-29 08:40:40