Been sketching a bit on what I think will be needed and could as well show what my
ideas are in an UML form. Now this is just what I'm thinking of and may change ... or
actually WILL probably change if things goes as they often do. But I had to do this to
get a clear picture of what I'm going to do and how the relations are. Maybe it will hold
and maybe not. Its not complete either, more a diagram of what's initially needed.
My main will contain 4 global items. A Player (of course), a list of PickItems, a list of
PickSockets and finally a GameControl.
GameControl:
Is responsible of keep things going and take care of the other components needed. It
contains the inventory, the player and a picker object which helps picking and grabbing
things. It is also is an EventListener taking care of events sent from various components
(so far just the Inventory). Items to be picked are detected here and handled by the Picker.
This control is actually a state machine with the states shown in the diagram
Player:
Not much to say here except that it contains a HealtMeter so we now when to die. This
meter will be visible on screen all time. Besides that it lives its own life.
PickItem:
This is the base of all things that build puzzles and events in the system. It can be
picked, moved around, dropped and stored, all depending on its type. There are some
different types shown in the diagram, all with their own speciality. Each type is
implemented as classes inherited by this base class. I wont go into the details, some
can be guessed by just reading the diagram.
PickSocket:
Some PickItem's are designed in order to work witch other specific object. They must
match each other, like a key and its keyhole. So this type of object only works
together with a specific PickItem. Together they will generate some action.
Besides this classes described here, there is a simple event-system for sending events
between components.
Oh.. and I'm very open for suggestions, questions and critique.