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 / HELP ME PLZ PLZ PLZ >>>>>>>>>>>

Author
Message
meno
21
Years of Service
User Offline
Joined: 15th May 2004
Location:
Posted: 16th May 2004 12:48
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
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 16th May 2004 14:33
the right way is one that works, there isn`t one "right" way, it depends on what you want to do and what the system the code is running on can handle, 99 modes is overkill if your card only handles 8 or so for example, you don`t HAVE to do those excercises (some of them are pretty pointless..like that one), just as long as you understand how it works in general, then move on and the more you learn the clearer things will become, then if you feel you have to you can return to that, but the time would be better spent researching loading objects/collision/sound etc (IMO)

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, ups.
meno
21
Years of Service
User Offline
Joined: 15th May 2004
Location:
Posted: 16th May 2004 18:18
THANKS FOR YOU BUT WHY YOU DID'T GIVE ME THE MAIN ANSWER>>>???CAN ANY ONE ANSWER ME?
comando 300
21
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 16th May 2004 20:39 Edited at: 16th May 2004 20:39
Please don't use CAPS LETTERS.

Thanks!

CURRENT PROJECT: RETRO PAC-MAN
Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 16th May 2004 22:11
the help system that comes with DB is minimal, it explains most of the commands but leaves you to work out the details for yourself, for example the flags in the set object command are not clearly explained, you need to fiddle about with them to work out what they do, since you have already seen the help system, what do you think of it?, thats what you get, you might like to look up some tutorials on general B.A.S.I.C, that should give you an idea of how things work, and please don`t use caps, thats reserved for shouting (or is your name "loud howard"?)

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, ups.
meno
21
Years of Service
User Offline
Joined: 15th May 2004
Location:
Posted: 17th May 2004 09:11
THANKS MENTOR FOR YOU BUT THIS PROBLEM TAKE FROM ME LONGTIME TO THINK ABOUT IT I JUST NEED TO KNOW HOW CAN I MAKE IT FOR THAT I ASK AND THANK FOR YOU



WHY YOU DON'T LIKE CAPS LETTERS??? comando 300
Arkheii
21
Years of Service
User Offline
Joined: 15th Jun 2003
Location: QC, Philippines
Posted: 17th May 2004 11:54 Edited at: 17th May 2004 11:56
Ahem... In a language he understands...

BECAUSE TYPING IN ALL CAPS MEANS YOU ARE SHOUTING HOLLERING AND SCREAMING AT THE PERSON READING YOUR POST AND REALLY HURTS AND POKES OUR EYES OUT TO HAVE TO READ WHAT YOU POSTED SO IT MAKES THE LESS TOLERANT PEOPLE NOT WANT TO HELP YOU AND THUS THEY GET REALLY MAD AT YOUR GODAWFUL MANNERS SO THE NICER PEOPLE TRY TO SAY IN A NICE WAY THAT YOU SHOULD NOT TYPE IN ALL CAPS BUT INSTEAD YOU BECOME A STUBBORN LITTLE SQUIRREL AND CONTINUE TYPING IN ALL CAPS AND YOU DONT EVEN HAVE PROPER PUNCTUATION LIKE PERIODS AND COMMAS SO I ASSUMED THAT IF I TYPE THE SAME WAY YOU DO YOU WILL UNDERSTAND WHY WE DONT WANT TO SEE PEOPLE TYPING IN ALL CAPS LETTERS

Okay, returning to default language.
1. The Help file is a reference. You use it when you need to learn more about a specific command, etc. It shows you the parameters of the command (if thera are any), gives a good description about the command, and even has examples for each of them. It's a handy reference, but to make a game or program you have to use what you learned from the help file. Use it only as a guide. Basic copy-pasting of code seems to be the only option when you have only started programming, but later on you would have to try out new methods that will better suit your coding style and preference. You can learn a lot from the help file alone.

About restoring the screen - Yes, that is an infinite loop. The help file was assuming that you already know how to quit your program and return to the editor by pressing F12. While you are still working on your program, pressing the Escape key will bring up the CLI (Command Line Interface, or you can just call it a console, like in some video games), so if you were in an infinite loop, the only way to exit would be to press F12. When the game has been compiled, however, pressing F12 will not do anything, but pressing Escape will quit your program. The problem is, if you disabled the escape key, there would be no way out of your program. A quick way to fix that is to insert the following code right after the ENDIF (Click this white button):


About the 99 display modes - Change these 3 lines:

into simply:


Now to explain the number 48. Apparently, the number 48 is the ASCII value of the keyboard character "0" (The zero character. Treat it as a string, not as a number.). Notice how the original code used inkey$() to return what keyboard character was pressed. The problem is, inkey$() returns a string, but we needed an integer value to assign to the variable position. To solve the problem, they came up with a very crude way of getting a keyboard character and turning it into a number. What it does is convert the string returned by inkey$() into a useable integer with the ASC() function. What ASC() does is return the ASCII value of a single character string, and since the ASCII value is an integer, it is just what the code needs and is something that we can use.

First, take a look at the IF statement. If you don't press any button, inkey$() returns a 0 right? So it ignores the code until the ENDIF and loops again so it can wait for another possible keyboard press. Now, in the checklist that it displays, the possible display modes printed out are preceded by a number , which is the value of the variable T in the FOR-NEXT loop. Since the counting starts at 1, it would be senseless to wait for the keyboard press "0" because it is not one of the choices. However, looking at my ASCII reference (In my QBASIC book), if "0" has ASCII value of 48, "1" is 49, "2" is 50, "3" is 51, "4" is 52, and so on until "9" which is 57. All the other characters have their own ASCII values, including both uppercase and lowercase letters, and other special characters, including the "wierd" ones that you get by holding ALT and pressing a number combination in the numeric keypad on your keyboard (Try this: Open notepad or Word and hold ALT and press the characters "4" then "8" in your keypad. What comes out is a "0" right? Basically, if you hold alt then follow it up with the ASCII value of a character, that character shows up, even if it's not a character on your keyboard. Try ALT then 164. You should see a "ñ" which is not on your keyboard. Cool right?).

So, when you push a character, inkey$() returns that character as a string, like if you pressed "0" inkey$() returns a "0". Then ASC() does it's job and gives you the ASCII value of "0" which is 48. Now, we subtract 48 from that number because we want to "offset" the number into something more understandable. So if you pressed "1" and got a 49, subtract 48 from that and you get the number 1, which to the program means that you chose selection number 1. Then you could have 2, 3, 4, and so on. It was comparing it to 48 so that it could avoid the 0, which is a non-existent choice in the program.

However, what happens when you go over "9"? ALT+58 says the next should be ":" so if you wanted to choose selection number 10, you would have to press the ":" key (You have to hold the Shift button). The ASCII value of ":" which is 58, minus 48, is 10. So to get eleven you would need to press ";" and so on. Not very appealing right? That is why you could replace it with an INPUT statement instead, like in the previous question.

Remember, if the variable name ends with a $, like AD$, it is a string, or a set of characters. However, if it doesn't end with a $, it is an integer. Integers are your ordinary "counting numbers" and can be either positive or negative. If it ends with a #, that is a floating point variable. These variables are intended to hold precise values like numbers with decimal values, such as 1.124125345 and can be either positive or negative. The problem with it though is you may experience very small inaccuracies with them (This is just a computer after all, and has very limited memory). So if in your INPUT statement you want the person to type the ASCII value + 48 equivalent of their choice, then be my guest and use INPUT AD$. However, if you want to make it easier and just input the exact number of their choice instead, then use INPUT AD. That way, if you want choice 10 then you just type "10" rather than typing ":".

John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 18th May 2004 17:44 Edited at: 18th May 2004 17:44
Using ALL CAPS is generally considered shouting on the internet. Begging for answers when someone is trying to help you is consider rude in general society. You should learn some manners before posting...

http://www.thegamecreators.com/?m=forum_view&t=28063&b=2

Read my guide on how to be a good 'netizen' or a 'Net Friendly Person'

I emphasize this picture



I suggest you study up before posting again. IF we had a warn system, you would surely be warned by now -_-

Thank you for the incredibly detailed response arkheii ^_^


We need help! Email us! [email protected]
meno
21
Years of Service
User Offline
Joined: 15th May 2004
Location:
Posted: 19th May 2004 14:45
firest of all thank you very very very much arkheii about that
and your help

two about Using ALL CAPS RPGamer i know how to write in cap or not
and i write in Forums (other Forum ) for more then sex years but i write in cap becuse i feel good when i write in cap not for other thing and i take this all time in normal way and than for every body

R
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 19th May 2004 14:52
Quote: "i write in Forums (other Forum ) for more then sex years but i write in cap becuse i feel good when i write in cap"


Yeah, it is quite tricky to hold down shift and type with 1 hand, caps lock is a god send.


Van-B


The nature of Monkey was irrepressible!.
meno
21
Years of Service
User Offline
Joined: 15th May 2004
Location:
Posted: 20th May 2004 17:40
VERY BODY HAVE ----TO LOOK TO HIS SELF TO KNOW ---- THAT THERE IS MANY THINKS THAT CANNOT EXPLAIN ABOUT HIS SELF NOT EVER THING IS NORMAL
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 21st May 2004 21:16
Translation: I think he has a handicap.
--
TAZ

History did not begin with PONG. -- Greg Costikyan

Game Beavers

Login to post a reply

Server time is: 2025-05-24 08:53:28
Your offset time is: 2025-05-24 08:53:28