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 / about help system

Author
Message
meno
21
Years of Service
User Offline
Joined: 15th May 2004
Location:
Posted: 15th May 2004 12:56
I HAVE SOME QUSTIONS ?

1- IS THE HELP SYSTEM THAT COME WITH DARKBASIC REAL GOOD AND LET MY MAKE REAL GAME?
2- 2-IN THE HELP I FIND THIS :
TUTORIAL THREE
SCREEN SWITCHER
AND THE CODE IS
----------
PERFORM CHECKLIST FOR DISPLAY MODES
CLS
FOR T=1 TO CHECKLIST QUANTITY()
PRINT T;" ";CHECKLIST STRING$(T)
NEXT T
DO
IF ASC(INKEY$())>48
position=ASC(INKEY$())-48
width=CHECKLIST VALUE A(position)
height=CHECKLIST VALUE B(position)
depth=CHECKLIST VALUE C(position)
SET DISPLAY MODE width, height, depth
ENDIF
LOOP


THEY TELL US TO:

Step 4 : Restoring the screen
It is a simple matter to restore the screen after a screen switch. Simply move the DO command from the middle of your program to the top. Your main loop is now complete.
BUT I DO THIS AND THIS MAKE INFINITE LOOP

DO
PERFORM CHECKLIST FOR DISPLAY MODES
CLS
FOR T=1 TO CHECKLIST QUANTITY()
PRINT T;" ";CHECKLIST STRING$(T)
NEXT T
IF ASC(INKEY$())>48
position=ASC(INKEY$())-48
width=CHECKLIST VALUE A(position)
height=CHECKLIST VALUE B(position)
depth=CHECKLIST VALUE C(position)
SET DISPLAY MODE width, height, depth
ENDIF
LOOP
AT LAST THEY TELL US TO
2. Change the program to allow the user to select up to 99 display modes
I DO THIS BUT I SURE THAT IT IS NOT RIGHT FOR MANY RESON

PERFORM CHECKLIST FOR DISPLAY MODES
CLS
FOR T=1 TO CHECKLIST QUANTITY()
PRINT T;" ";CHECKLIST STRING$(T)
NEXT T
DO
INPUT AD$
IF ASC(AD$)>48
position=ASC(AD$)-48
width=CHECKLIST VALUE A(position)
height=CHECKLIST VALUE B(position)
depth=CHECKLIST VALUE C(position)
SET DISPLAY MODE width, height, depth
ENDIF
LOOP

WHAt is the right way ??? and what the 48 in code mean
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 21st May 2004 04:38 Edited at: 21st May 2004 04:39
Dude, turn off your caps lock, in the digital world it's kind of rude to write in all caps, gives the impression you're shouting at people.

When there's an infinite loop in example code it's assumed your running it in the actual DarkBasic program so you can just press Esc or F12 and it will automatically quit out of the program. YOu will obviously need to write a way out of loops when you actual write games.

To figure out what the 48 means, you'll have to research the ASC() command. 48 could be an ASCII character code, a color value, part of a coordinate pair, or it may just be a regular number that is fed into the ASC() function to get a desired result.

The help system in DB is pretty good if you have a basic knowledge of programming, otherwise it kind of stinks. Check out the Beginner's Guide to DarkBasic Game Programming if you can't figure i tout.

Crazy Donut Productions, Current Project: KillZone
Web Site Button Does Not Work, Visit Here: http://www.geocities.com/crazydonutproductions/index.html

Login to post a reply

Server time is: 2025-05-23 22:17:49
Your offset time is: 2025-05-23 22:17:49