|
| DOS Games Discussion A message board to talk about DOS games, get help, and find old games. Do NOT post warez or abandonware requests please
|
|
|
| Author |
Message |
Interon Guest
|
Posted: Sat Feb 28, 2004 10:16 pm
Post subject: So you want to be a programmer, eh? |
|
|
It can be a tedious, boring job for those new to it. You need lots of patience and persistence if you are ever to do anything useful with it. To make DOS games, try QBasic. It is easier than C++ and Assembler and is a great way to get started.
Here, take some code from me to get you started. This is a simple trivia game. Replace the questions and answers with what you want to use.
This code might help you learn QBasic.
| Code: |
1 CLS
CLEAR
GOSUB QUESTION1
GOSUB QUESTION2
QUESTION1:
LOCATE 1, 1:INPUT "What is the capital of Canada?", Q$
IF UCASE$(Q$) = "OTTAWA" THEN CLS
IF UCASE$(Q$) = "OTTAWA" THEN LOCATE 1, 1: PRINT "Correct!"
IF UCASE$(Q$) = "OTTAWA" THEN LOCATE 2, 1: PRINT "Press any key to continue . . ."
IF UCASE$(Q$) = "OTTAWA" THEN DO: LOOP WHILE INKEY$ = ""
IF UCASE$(Q$) = "OTTAWA" THEN RETURN
LOCATE 1, 1: PRINT "WRONG!"
LOCATE 2, 1: PRINT "Press any key to continue . . ."
DO: LOOP WHILE INKEY$ = ""
RETURN
QUESTION2:
LOCATE 1, 1:INPUT "What color is coal?", Q$
IF UCASE$(Q$) = "BLACK" THEN CLS
IF UCASE$(Q$) = "BLACK" THEN LOCATE 1, 1: PRINT "Correct!"
IF UCASE$(Q$) = "BLACK" THEN LOCATE 2, 1: PRINT "Press any key to continue . . ."
IF UCASE$(Q$) = "BLACK" THEN DO: LOOP WHILE INKEY$ = ""
IF UCASE$(Q$) = "BLACK" THEN RETURN
LOCATE 1, 1: PRINT "WRONG!"
LOCATE 2, 1: PRINT "Press any key to continue . . ."
DO: LOOP WHILE INKEY$ = ""
RETURN
|
|
|
| Back to top |
|
 |
donkeydude Member

 Joined: 26 Feb 2004 Posts: 21
|
Posted: Mon Mar 01, 2004 12:54 pm
Post subject: |
|
|
yeah, got qbasic.
Is it just regular BASIC, or is it different? |
|
| Back to top |
|
 |
Interon Guest
|
Posted: Mon Mar 01, 2004 8:40 pm
Post subject: |
|
|
| It is a more complicated version of BASIC. It uses most of the old BASIC commands so that you could open a BASIC file in QBasic and about 99% of the time it should run. However, QBasic has lots of extra stuff that BASIC doesn't. It's like comparing Windows 3.1 to Windows 95. |
|
| Back to top |
|
 |
donkeydude Member

 Joined: 26 Feb 2004 Posts: 21
|
Posted: Tue Mar 02, 2004 2:52 pm
Post subject: |
|
|
what, like more commands? sounds good...
 |
|
| Back to top |
|
 |
Interon Guest
|
Posted: Tue Mar 02, 2004 3:09 pm
Post subject: |
|
|
| Yeah, that, and separate subroutines, and higher limits. It is a relatively new Basic, by Microsoft, a major player in the Basic programming language versions. |
|
| Back to top |
|
 |
Icedragon Lord of Gaming

 Joined: 21 Mar 2004 Posts: 229
|
Posted: Thu Apr 22, 2004 7:13 pm
Post subject: |
|
|
| QBasic is cool. I like downloading the games like nibbles and gorrila, and screwing with the colours. |
|
| Back to top |
|
 |
laogaming Guest
|
Posted: Thu Apr 22, 2004 7:49 pm
Post subject: |
|
|
| AHHHHH!!! QBASIC AHHHHH!!!!!!! man i hated basic when i started it, i love c |
|
| Back to top |
|
 |
ripster88 Member

 Joined: 06 Jul 2004 Posts: 26
|
Posted: Tue Jul 06, 2004 12:56 am
Post subject: |
|
|
| Where do you get Qbasic???? |
|
| Back to top |
|
 |
emmzee Site Admin

 Joined: 14 Sep 2002 Posts: 2149 Location: Mississauga, Ontario, Canada
|
|
| Back to top |
|
 |
Nixon Guest
|
Posted: Tue Jul 06, 2004 4:52 am
Post subject: |
|
|
Ya should get Qb 4.5 or higher cause you can make .exe with it.
try searching in google cuase I'm to lazy to find a link.
I been programmingin Qb for a few years, but firsat I started In zzt. |
|
| Back to top |
|
 |
ripster88 Member

 Joined: 06 Jul 2004 Posts: 26
|
Posted: Wed Jul 07, 2004 1:33 am
Post subject: |
|
|
I managed to find Qb 4.5. Thanks guys, I'm gonna try it out now.
Say, does any of you know where I could get some games so I can play around with them??? (I've already got the one above) |
|
| Back to top |
|
 |
Interon Guest
|
Posted: Wed Jul 07, 2004 3:42 pm
Post subject: |
|
|
| Invaders 1978 contains the source code |
|
| Back to top |
|
 |
Game master pro Guest
|
Posted: Thu Jul 22, 2004 3:41 am
Post subject: |
|
|
I cant download it, it says "the page cannot be displayed thing" are you sure you got it right |
|
| Back to top |
|
 |
barok Member

 Joined: 15 May 2004 Posts: 30 Location: bushlands of saskatchewan
|
Posted: Sat Jul 24, 2004 11:12 pm
Post subject: |
|
|
This site offers all versions of qb, including some vb downloads.
http://www.download-qb.tk/
if you wish to start qb, the site i recommend is this:
www.qbasic.com
a good site to show you what can be made in qb:
www.vplanet.cjb.net
btw interon, your program is horribly inefficient. you do way too many of the same checks over and over.
1 CLS
CLEAR
GOSUB QUESTION1
GOSUB QUESTION2
QUESTION1:
LOCATE 1, 1:INPUT "What is the capital of Canada?", Q$
answer$ = ucase$(Q$)
IF answer$ "OTTAWA" THEN CLS
LOCATE 1, 1: PRINT "Correct!"
LOCATE 2, 1: PRINT "Press any key to continue . . ."
DO: LOOP WHILE INKEY$ = ""
RETURN
endif
LOCATE 1, 1: PRINT "WRONG!"
LOCATE 2, 1: PRINT "Press any key to continue . . ."
DO: LOOP WHILE INKEY$ = ""
RETURN
QUESTION2:
LOCATE 1, 1:INPUT "What color is coal?", Q$
answer$ = ucase$(Q$)
IF answer$ = "BLACK" THEN CLS
LOCATE 1, 1: PRINT "Correct!"
LOCATE 2, 1: PRINT "Press any key to continue . . ."
DO: LOOP WHILE INKEY$ = ""
RETURN
endif
LOCATE 1, 1: PRINT "WRONG!"
LOCATE 2, 1: PRINT "Press any key to continue . . ."
DO: LOOP WHILE INKEY$ = ""
RETURN
furthermore you continually use do: loop while inkey$ = "". to make the code easier to read, easier on the fingers and to minimize syntax errors, you should create a waitkey subroutine that waits until a keypress. |
|
| Back to top |
|
 |
Interon Guest
|
Posted: Sun Jul 25, 2004 1:45 pm
Post subject: |
|
|
| Yeah, despite making 4 games, I'm still kind of an amateur. |
|
| Back to top |
|
 |
|
Powered by phpBB © 2001, 2005 phpBB Group and Ask an Expert
Also powered by Darren and the other admin and mods' hard work! ;)
|
|