CSC 8310 Java Adventure Assignment
David Matuszek, Villanova University, Summer 2001

In the Prolog assignment, I gave you a simple (boring) adventure game, and you were asked to turn it into a more interesting game

Once again, I'm giving you a simple (boring) adventure game, this time in Java. But what I'm asking you to do is completely different.

1. Download the provided program

I've written the program as a BlueJ package, and zipped it up. Download the file adventure.ZIP and unzip it. You can open this package directly from BlueJ.

If you want to use JBuilder, Visual Age, or Forté instead of BlueJ, that's OK. (J++ is not OK.) In this case, your readme.txt file should tell which IDE you used. If you can't start the program just by typing java Game in the MS-DOS window, you must also provide instructions on how to start your program.

2. Add a "point-and-click" interface (60 points)

The GUI that I've provided is a very simple one; you type in commands at the bottom, and the transcript (commands and results) appears in the rest of the window. It looks something like this:

Your task is to add Components (such as Lists and Buttons) to this GUI, so that you can do most operations just by pointing and clicking, rather than typing in commands. (But keep the ability to type in commands.)

My GUI for doing this looks like:

In this GUI:

Your GUI does not need to look exactly like this!

Create several more items and add them to the game, so that you have something to display in your You see: and You are holding: lists. Add a few more rooms and paths between rooms, for much the same reason. You don't have to do anything complicated with the things and paths; they are just for testing your GUI.

3. Add a Thread for Gorgo (10 points)

The program has a Neandertal (cave man) class, and I've created a Neandertal for you. His name is Gorgo, but feel free to change that if you don't like the name.

A Neandertal will wander around and do things by himself/herself, but you have to get him started. All the hard work has already been done for you. All you need to do is create a separate Thread for your Neandertal, and every ten or fifteen seconds have your Neandertal doSomething().

4. Improve the look command (20 points)

The command look will tell you if Gorgo is nearby, but the commands look Neandertal and look Gorgo don't see anything (they only tell you about Things, and Gorgo isn't a Thing). Fix it so that these commands work.

5. Save the transcript (10 points)

Provide both a text command and a Button for saving the transcript to a text file. If you look carefully at the program, you will find that all the hard work has already been done.

6. Make the adventure game more interesting (extra credit)

If you want to turn this into an interesting adventure game, feel free (but be sure to tell us that you've done so!).


Notes:

  1. This is a new program, and yes, there may be bugs in it. If you are the first to report a bug and tell me how to fix it, I will probably give you some extra credit for it (depending on the nature of the bug). I will post bug reports on the Web, but I will only upload a new version of the program if there is a really serious error.

  2. Don't forget to update the readme.txt file. You can do this from within BlueJ by clicking on the text icon in the project window.

  3. You might (or might not) find my javadoc documentation for this program useful. You can see it from within BlueJ by choosing Interface rather than Implementation in any class window.

  4. It would be a good idea to add a new @author tag (but you should keep mine) in each of the classes that you modify.

  5. Please check the CSC 8310 web site frequently in case there are any major changes to the program or to the assignment. (I hope there won't be.)

Due date: July 5. Please turn in a floppy with everything on it, including all necessary compiled code. Please do not turn in any paper. Please do not e-mail your assignment to me without a very good reason.