Due: Friday, April 11 at 11:59 pm.
Your assignment is to create a game based on Zuul, the game described in chapter 7. I would suggest you start with either zuul-better or one of the enumerated type versions (discussed towards the end of the chapter).
First, you should decide what the goal of your game is. It should be something along the lines of: You have to find some items and take them to a certain room (or a certain person?). Then you can get another item. If you take that to another room, you win.
example: You are at
Or: You are lost in a dungeon. You meet a dwarf. If you find something to eat that you can give to the dwarf, then the dwarf tells you where to find a magic wand. If you use the magic wand in the big cave, the exit opens, you get out and win.
It can be anything, really. Think about the scenery you want to use (a dungeon, a city, a building, etc) and decide what your locations (rooms) are. Make it interesting, but don’t make it too complicated. (I would suggest no more than 15 rooms.) Put objects in the scenery, maybe people, monsters, etc. Decide what task the player has to master.
D-level functionality (correctness)
At this level, you have to implement your scenario with the following functionality:
C-level functionality (correctness)
D-level with the following modifications:
· Add at least four new commands (in addition to those that were present in the code in zuul-better).
B-level functionality (correctness)
C-level plus the following:
· The initial game setup is read from a file. The file contains lines of three types:
o room name description – where name is a one-word unique name for the room and description is a string that describes the room
o exit room1 direction room2 - where room1 is the name of a room, direction is a one-word direction, and room2 is the name of the room that is connected by that exit from room1
o item name weight location – where name is a one-word item name, weight is the item weight and location is the name of the room where the item is initially located
· As each line is read, the correct method is called to set up the appropriate initial game state. You need to include error checking for the input (for example: does the room already exist?) with some output to the player if there is a problem. Hint: Consider using a HashMap to store the rooms in the game by their names.
To the B-level functionality, add at least two additional features. The features should be non-trivial and should indicate some effort. If you have an idea and are not sure, clear it with me first. Ideas include:
give bread dwarf
to give some bread (which you are carrying) to the dwarf.
Creativity and cleverness will also be considered when considering whether the A level has been reached.
See the style guide posted on our web site. Approximately 30 percent of your project grade will be based on coding style, including documentation. Generally I will divide this into an assessment of
The handin name for this project is project3. It will be due at 23:59 Friday, April 11. When you hand it in, please handin the entire directory for project3. Copy the files to a directory called project3 on cerebro and then, from the directory above project3, type:
handin 180 project3 project3/*
Check the syllabus for a discussion of academic honesty. This project must be your own work.