Game design
The world object
The world will be a grid. Moving north will increase the row count while moving south will decrease it. Moving east will increase the column count while moving west will decrease it. In terms of our map the row, column arrangement will be:
The class will consist of a two dimensional list with the location objects stored in it. And the class diagram is:
World class |
---|
|
|
Item objects
There will be three of these objects; the coin, the picnic, and the key. These will be the simplest of objects as they only have a name and a description.
The class diagram for the item class will look like this:
Item class |
---|
|
|
Location objects
There will be five of these objects. Some, like the quad, will only have a name, a description and the ability to have another object in them to collect. Others like Admin have a name, two descriptions - the external, locked description and the internal, unlocked description. They will also need a state property to keep track of whether they are locked or unlocked. We will also allow the player to drop objects at locations. We won't use this in our game but it shows how this can be used at a later point.
The class diagram for the location will look like this:
Location class |
---|
|
|
Actor objects
The game has one actor, Joe. The purpose of the actor is to have the player interact through talking so Joe will have to respond to "talk joe". It is going to be very boring if Joe always says the same thing so we will be designing the actor class to have a range of responses.
The class diagram for the actor will be:
Actor class |
---|
|
|
Complex objects
There are three objects left; the safe, the book, and the computer, that are objects that can be intereacted with. The player will "open safe", "open book", and either "type computer" or "login computer" The book will immediately reveal the teacher's pass code but the safe and the computer will ask for an input. We will keep these objects in the same class and deal with the differences within the class programming.
The class diagram will be:
Complex class |
---|
|
|
The player object
We will need a class to keep track of the player. The player has a location within the world, that is their row and column. They also have their collection of items.
The class diagram is:
Player class |
---|
|
|