|
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.
|
|||||||||||||||||||||||||
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. |