QBasic is a programming language developed by Microsoft. It's based closely on the BASIC language, whose letters stand for Beginners All Purpose Symbolic Instruction Code. QBasic can make many different types of programs, including video games. A key step in making such games from scratch is designing the game, which means writing in detail how you want the game to work. Personal satisfaction is one benefit you get from making QBasic games. Another is increased programming skill, which you can apply to other programming projects, including those in other languages.
- Skill level:
Other People Are Reading
Download a QBasic game, such as the Space Battles game on Pete's QBasic site, Jack's 3-D Game from the same site or Moonbugs from the QBasic Station site (see Resources).
Read the game's program listing, including all comments. If you understand what a statement without a comment means, write your own comment. For example, you may read the statement "flagGameOver = true" and write, "This statement is indicating that the game is over." Once you can write a comment explaining each line of the program listing, you'll understand the game well enough to turn it into your own game.
Execute the game one statement at a time, using your development environment's debugging tools. Read your environment's documentation for details on code stepping, which is how programmers refer to executing one statement at a time.
Write on paper, as you're stepping through the game, the value of each variable as it changes. For example, you may write "The variable 'PlayerPoints' held '1' before I answered the trivia question correctly. It now holds '10'."
Write, in the program listing, new comments that reflect your increased understanding of the game. For example, after observing the hypothetical "PlayerPoints" variable in the previous step, you may write "'PlayerPoints' holds my score, which is based on correct answers to the game's questions."
Repeat Steps 3 through 5 until you've written a comment for each statement in the game's source listing. You can now make modifications to the game.
Write on paper a list of changes you'd like to make to the original game. One change might be, "The option for changing the turret's angle should be on the 'gunner' screen, not the 'ship commander' screen." Be as specific as you can in describing each change, as this makes programming easier.
Write the QBasic source code that implements the list items from the previous step.
Test and debug the game using your development environment's debugging tools.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for