Create a CMD Adventure
Have you ever thought of how clever the old text-adventure games must have been? Jealous of the knowledge the programmers had? Well, now you can create your own!
Steps
- Learn Some Batch. This will be easy; it will only take 5-10 minutes to learn. Most of the programming needed for this is explained in other articles like "How to Create a Small Game in Batch". Again, don't be worried about this step, for Batch is so easy a 10-year-old can learn it.
- Get a Basic Idea of Your Game. This part is crucial, but pretty easy. Just come up with things like the name of it, genre, etc.
- Begin. Create a new folder (preferably on your desktop) with the name of your game. Don't use any special characters or spaces, only letters, dashes, and underscores. An example is: "mazes_and_monsters". This way, Command Prompt will be able to open it.
- Make The First File. Open up Notepad, and write something similar to this:
-
@echo off
- :start
- echo Mazes and Monsters
- echo The MS-DOS Adventure
- echo
- echo Underground Cavern
- echo You awaken in an underground cavern.
- echo
-
- After that is done, save it as START.bat, RESTART.bat, etc. and put it in the game file.
- Create Commands for Your Game. To do this, make a batch file for each command and place them in the game file. Like EXAMINE.bat. It would look something like this:
-
@echo off
- if "%1" == "torch" goto torch
- if "%1" == "tree" goto tree
- :torch
- echo The torch is lit, and spreads light across the room.
- echo.
- :tree
- echo It is a tree.
- echo.
-
- "if "%1" == "torch" goto torch" is if they were to enter "examine torch". This does not have to be here. If it is a command that is not used on certain objects, it could look like this:
-
@echo off
- :start
- echo You are in a dim cavern. You see a hallway going to the right and one to the left.
- echo.
- :left door
- echo The wooden door is barged shut and locked.
- echo.
- So, if you were to enter that command while you were accessing the :start label, it would show "You are in a dim cavern. You see a hallway going to the right and one to the left," yet if you were to enter "examine" while accessing the :left door label, it would show "The wooden door is barged shut and locked."
-
- Start the Game. Once you're finished with most or the entire game, you'll want to test it. Open Command Prompt, make your way to your game file and open it. Remember when we created the "START.bat" file? We're almost to that. Now, type @echo off, cls, and "start". That will take you to that file, and voila. Try to enter the different commands, test some other things, etc.
- Once you near completion, add a README.txt file explaining the game and instructions to starting it in the game file. Then you're ready to go ahead and upload the game file to the World Wide Web.
Tips
- Download "The Hobbit" (MS-DOS version) and take a look at that from here: http://www.wurb.com/if/game/104 That will give you a better understanding of how this works.
- ASCII art might take a while, but it definitely adds to the player's experience.
Related Articles
- Make a Text Based Adventure in Batch