[Tutor] designing POOP
alan.gauld at btinternet.com
Wed Feb 6 18:06:09 CET 2008
"bhaaluu" <bhaaluu at gmail.com> wrote
> Here is my description, in plain English.
> Text Adventure Game Requirements:
> 1. The Explorer enters her name at a prompt.
> 2. Other things are initialized at this point.
> 3. The layout of the Castle is defined.
> 4. Treasure is placed in rooms in the Castle.
Actually thats not really plain English its a very structured
English. In fact it approaches procedural pseudo code!
Its possibly a little too detailed too.
I'd go for a more free-form paragraph or two(at most) something
I want to build a text adventure game based around
an explorer moving around a castle with multiple rooms,. In
each rooms there could be various items of treasure or monsters.
To win the game the explorer has to collect as much treasure
as possible and defeat as many monsters as possible. Treasure
is worth points and the expolorer starts off with a given amount
of strength and points. ......
Because its a text game the interface will consist of a series
of input prompts with responses and printed status messages.
The game is over when.....
That should be shorter and less likely to predispose your thinking
to a particular approach - such as when the initialisation takes
place, or how many rooms or premature consideration of the
command structures etc. These things should emerge as you
create the object definitions and interactions. The initial aim is
only to find the half dozen to a dozen key classes top get started.
Other classes will emerge as you progress, and some of the
original candidates may merge into others or be discarded.
And don't forget that there could well be a game class/object to
control the overall flow of the game and coordinate the actions
of the other objects. For example the prompt/response/display
mechanism might be part of the game class (and they might
be classes too!). This would maximise reuse of the compnent
objects within a different game framework ( a GUI fort instance)
Author of the Learn to Program web site
More information about the Tutor