project 4 - Project 4: Interactive Fiction Due Date: Nov...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Project 4: Interactive Fiction Due Date: Nov 1st Once upon a time, before the dawn of the Internet as we know it, there lived a forgotten type of computer game called interactive fiction. First written in the late '70s, these games were sort of a choose-your-own adventure book, but for geeks. These games contain no graphics, just a 2 nd person (everybody remembers English class right?) description of your character, and a box for entering commands. With the birth of the kindle and other Internet enabled e-readers, these games are experiencing something of a rebirth, as their screens are a perfect match for these games. To play one for yourself, go to http://www.portablequest.com . Your project is to create an interactive fiction. To help you along, a couple of classes have been written for you, you only need to make the guts of the game, called the engine. You should have received Map.java, Room.java, Lamp.java, and Chest.java along with this pdf. Begin by taking a quick a look at the Map class. This class is completely implemented, you don't need to do any work on it, but you do need to know how to use it. In this game, a map is a square of size NxN. You call the getRoom(X,Y) to retrieve the Room object for a given square. The first number (X) gives the row and the second (Y) gives the column. The starting room is at (0, 0). The description of the interface for this class is given at the end of this pdf. Now take a look at the Room class. This class is implemented for you as well. It contains a large number of methods for you to use during the game. As you can see, there are no setters, only getters. This means that for the most part you cannot modify any Room objects you receive. The exceptions are the clearKey() and clearLamp() methods that modify two of the room's sub-objects. You'll see down below when you need to call these methods. If a room does not have a specific sub-object, its variable will be set to null. You will need to test for this condition to see if a room has a sub-object or not. The description of the interface for this class is given at the end of this pdf. You should NOT modify Room or Map to get your game working, your project will be tested with our own versions of these two files, so any modifications you make could result in your project not compiling or not working correctly. 1. You should start your work by implementing the Chest class (a skeleton is provided for you). It needs to store whether it is locked or not, a String describing the contents, and which key it was locked with. The method stubs for this class are provided with comments, be sure to implement them the way they are described. You should not add any more methods to this class. 2.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

project 4 - Project 4: Interactive Fiction Due Date: Nov...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online