Lab 6: Completing your game
The goal of this lab is to practice extending an object-oriented
system.
You will pick up where you left off last week in the adventure game project.
There are five heads under which today's changes will fall: the rooms/game,
the commands/parser, the items, and the inventory.
These are all interconnected, and accordingly some parts of the following
specification are duplicates.
- Rooms
- Design the game so that there are at least five rooms. Three rooms will
be on the same level of the building, one will be upstairs, and one
will be outside.
This will require more sophistication in the direction commands
than merely four directions (for example, you will need an "up" direction).
- Every room should have a description that is displayed
when the player enters the room.
- More information about the room (for example, available exits,
items) should be displayed when the "look" command is issued.
- Modify the connections between rooms so that they can be doorways
(always open) or doors (which can be open, closed, or locked).
- Commands
- General directions must be implemented.
Since you cannot predict what valid directions a room might have,
make sure that the names for the directions are not hard-wired into
the classes.
You may choose whether the string the user enters to move in a certain
direction is, say, "east" or "go east".
- There should be a "look" command that triggers a detailed
description of the current room.
- There should be a "help" command that lists context-specific help--
what commands are currently valid.
- There should be an "inventory" command that lists items
currently held by the player.
- There should be a use command that allows the player
to use something in the inventory.
- There should be "pick up" and "drop" commands to
take an item from a room and put it in the inventory and likewise
to remove something from the inventory.
- Items
- There should be at least two items somewhere in the game.
- The player should see it with the "look" command.
- If the player issues the "take" command, then it is removed
from the room and added to the inventory; so,
after "take", it should no longer be reported by the "look" command,
but it should be reported by the "inventory" command.
- If the player issues the "drop" command for an item, it should
be removed from the inventory and added to the current room.
- The item should be able to be used.
Right now, a message should be printed to the screen describing
the effects of using the item.
It is up to you whether this should use up the item or not.
- Inventory
- The player should have an inventory, a collection of items
that have been picked up.
- The commands "take", "drop", "inventory", and "use" all
need access to the inventory.
Your goal is to have all of this working in 150 minutes.
Get to it.
Your game should require finding some particular item and taking it
to the exit. You may introduce traps, and you may also introduce
characters (items that move around randomly or on a pattern).
I'll try to give you a little more guidance on a story line. Your
group will need to complete the working game by midnight on Wednesday,
March 27. (That's a week and a half after spring break).
Last modified: Thu Mar 7 13:02:29 CST 2013