Assignment 9: Adventure Game
Fall 2006, David Matuszek

Purposes of this assignment:

General idea of the assignment:

Write a text adventure game.

If you have no idea what I'm talking about, go to and play around for awhile.

Most adventure games use commands of two or more words. We're just going to use buttons.


The game itself:

An adventure game consists of:

Your assignment is to write a small adventure game. By "small" I mean somewhere between four and twelve rooms, and four to eight objects; at least two of the objects should have some "use" relevant to the game. Each partner should do some rooms and some objects. The theme of the game, and the goal of the game, is up to you.

The GUI:

You also need to write a Swing GUI to allow a person to play the game. Although there is only one GUI, I would like each partner to write all the code (creating the components, laying them out, attaching listeners) for part of the GUI. For that reason, I'm dividing the GUI up into four "areas," as follows:

The above division of the GUI is suggested, not absolutely required. You can rearrange things as necessary to create a good-looking GUI, but each partner should do all the work for a JComboBox, some JButtons, and a text component.

Separation of concerns:

The classes for the game itself should not do any input/output; in particular, they should not use the GUI in any way. The game should not even "know" the GUI exists. Instead, the GUI should use the classes and methods of the game.

I am providing a sample game, McGame.jar. This is a very simple game where the main class (McGame) uses the classes and methods of the game, and does all the (text-only) input/output; the game does not "know" who is calling it. (Note: you can execute the game by double-clicking it, or you can change the name to and unpack it.)

Last-minute additions:

No JUnit tests are required for this assignment.

As always,

When you turn in your program, include a readme.txt file to tell us how to play your game to a successful completion.

Due date:

Thursday, November 16, before midnight.