Escape
to
Pokagon

Full Text Implementation in C++

This version builds upon the previous versions (parsing the data file and supporting movement only) and creates a fully functional text-based adventure game. The adventurer can move around, take and drop items anywhere, look around, check inventory, view the current score, and obtain help. Program is organized into four main components. The Room class deals with how one represents a room. The Item class deals with how to represent an item. The Command class is used as the parsing mechanism; when a command is entered from the user, a Command object is instantiated which breaks the input down into a verb, a noun, and a direction (as most of the commands fall into the <verb=move, noun=direction> category). Finally, the simulation is controlled by the adventure.cpp module. A fifth, but minor, component is stringapps, where code is located for performing string trimming and toLowercase operations. Included below is a screenshot from my implementation of the engine:
   
Resources:  
To make this assignment easy to adopt, a variety of resources are at your disposal. Copies of the assignment handouts are available in both Word and PDF format. In addition, data files, header files and supporting documentation are freely available; however, source code is available by request to faculty members only.

Adventure Engine Source Code:  
Main program adventure.cpp (9 KB)  
Room class room.cpp (8 KB) room.h (3 KB)
Item class item.cpp (4 KB) item.h (2 KB)
Command class command.cpp (4 KB) command.h (2 KB)
String applications stringapps.cpp (1 KB) stringapps.h (1 KB)
Generic data files exampleRoomData.txt (3 KB) exampleItemData.txt (1 KB)
Header file documentation MS Word (46 KB) Adobe PDF (125 KB)

Head back to Pokagon....

Follow the twisty link back to the nifty adventure assignment....
Web page created 9 February 2002 by John K. Estell, ECCS Department, Ohio Northern University.