Comp 170 project: Extending Zuul, Nov 8

You are to add some new puzzle rooms to the World of Zuul project. My most recent version is here. (Note that it does not include a weight check for the TAKE command.) This is considered to be a "programming project" rather than a lab; while you are encouraged to work on the project during lab time, you won't necessarily finish it there.

The official due date is Monday, Nov 20. I will accept assignments submitted throughout the Thanksgiving weekend without late penalty, though (the only penalty is having to work on it then).

You are to add two new puzzles, each with at least one (probably only one) special class extending Room. Your puzzles should, in total, involve at least two new words, including at least one new command word (don't forget to add it to CommandWords.java!!) You will also have to make minor changes to the Game class to patch your new rooms (and other rooms) into the game. Try not to change the basic Game/Room interface.

I discussed the Player class briefly last Monday; note that the current player is a parameter to the main Room methods like respond() and getExit(). Note that there is at this time no option for more than one player.

Another recent change is that I moved the creation of the maze of Rooms to its own class, RoomMaker. This way, you will likely not have to make any changes to the Game class itself.

Team Option: You may pair up with a classmate and do your project together. In that case, you should have three new puzzle rooms, at least two of which use a new command word.

In either case, you are to add enough plain Rooms, and enough description, to produce a playable game. Your new rooms should follow a reasonably sensible "map".

You will be graded in part on the inventiveness and originality of your puzzles. Adding a superclass of Item (as in the Locked Room example, #1 below) is not required, but can sometimes lead to cleverer puzzles. Here are a few possible examples:

1. Different flavor of Locked room. The command UNLOCK DOOR works only if you have the CORRECT key. You define a class Key extends Item {...}. Keys have some kind of (numeric) attribute that allows the game to determine which key is correct, though the number isn't visible to the player. (A simpler version where you have to give the command UNLOCK DOOR but any KEY will work is also acceptable.)

2. Room with heavy stone. The commands are MOVE STONE, EAT COOKIE. Sample play transcript:
    You have entered a room with a huge stone in the center. It looks like it might be covering something.
    MOVE STONE
    You are too weak and hungry to move the stone.
    EAT COOKIE
    Wow! That made you feel stronger!
    MOVE STONE
    Filled with a burst of strength, you move the stone. A moneybag is revealed.

3. Dragon's room, from which escape is blocked until you defeat or befriend the dragon. Note the "advance warning" here that, well, you'll need to find the SWORD first.
    GO NORTH
    The passage is littered with bones. A dragon's roar splits the air. I hope you have a weapon!
    <<... go back and GET SWORD...>>
    GO NORTH
    You have entered the lair of the dragon. His tail flicks behind you and the exit door latches closed.
    GO SOUTH
    the dragon won't let you out
    ATTACK DRAGON
    The dragon is injured!
    ATTACK DRAGON
    The dragon dies!
    GO SOUTH
    The passage is littered with bones.
    GO NORTH
    You have entered the lair of the dragon. His dead body lies before you. Exits: south north
    GO NORTH
    You have entered the dragon's treasury

4. Buried treasure
    GO EAST
    You are on a sandy beach. An X is drawn on the sand.
    DIG
    You don't have a shovel
    << go back and GET SHOVEL..>>
    GO EAST
    You are on a sandy beach. An X is drawn on the sand.
    DIG
    A locked treasure chest is revealed!
    TAKE CHEST
    You can't take that!
    UNLOCK CHEST
    You don't have the key ...
    << go back and GET KEY..>>
    UNLOCK CHEST
    A necklace is revealed; it appears to be made of diamonds.
    TAKE NECKLACE

5. Taking an exam. You have to study and eat first, though! Note that the studying (and eating) is done in the hallway here. Both hallway and examroom are "special", but with a little thought they can be the same class (as in the ValveRoom example). This is probably the hardest puzzle illustrated here.
    GO NORTH
    You have entered a classroom. An exam is about to begin.
    TAKE EXAM
    Are you sure? You naven't studied and you're too hungry.
    GO SOUTH
    You're in the hall by your locker. The following things are here: BOOK SANDWICH
    READ BOOK
    Kant's _Categorical Imperative_ is dense reading, but finally you get what he's saying.
    EAT SANDWICH
    You are happy and content
    GO NORTH
    You have entered a classroom. An exam is about to begin.
    TAKE EXAM
    Wow! You get an A! The professor gives you a gold_star

Email me your completed project.