Forcing those classes to be singletons isn't really necessary. You just normally keep one instance of those classes around anyway. I actually think it's simpler to not bother with making them singletons. Plus there might be some instances where you want more than one instance of one of those classes. Like for dynaimcally loading one level while the player is in another.
class Application
| Purpose: | Holds everything for the program |
|---|
| Contents: | Main program entry point function
Game object
Menus collection
Form object
RenderDevice object
SoundDevice object |
|---|
class RenderDevice
| Purpose: | Interfaces with the graphics library for all the rendering. |
|---|
| Contents: | All stuff needed for the graphics library
Reference to the form to draw to |
|---|
class SoundDevice
| Purpose: | Same sort of thing as the RederDevice. |
|---|
class ResourceManager
| Purpose: | Stores, loads, and otherwise manages all resources. |
|---|
| Contains: | IResource collection |
|---|
interface IResource
| Purpose: | Abstract base class for all resources (such as graphics, sounds, etc.). Primarily used for keeping track of resources in the Resource Manager. |
|---|
class GraphicResource : IResource
| Purpose: | Contains a graphical resource. |
|---|
class SoundResource : IResource
| Purpose: | Contains a sound resource. |
|---|
class MusicResource : IResource
| Purpose: | Contains the stuff for a music resource. Not actually in memory as it would probably be a streaming thing. I am a little unclear on this one. |
|---|
class Game
| Purpose: | For everything in the actual game (as in part of the gameplay), and nothing else. |
|---|
| Contents: | Level object
Player collection
Game state (running, paused, quit) |
|---|
class Level
| Purpose: | For everything in a single level. |
|---|
| Contents: | Tileset collection
Layer collection
Object collection |
|---|
class Layer
| Purpose: | Contains the arrangement of tiles that make up the level. |
|---|
| Contents: | Tile collection (array) |
|---|
class Tileset
| Purpose: | Contains a full tileset. |
|---|
| Contents: | TilesetResource object
Tile count |
|---|
struct Tile
| Purpose: | Represents a single tile on a single layer |
|---|
| Contents: | Tileset index
Tile index |
|---|
interface IGameObject
| Purpose: | Abstract base class for all dynamic objects in the game. |
|---|
interface IUpdatableObject
| Purpose: | An object that can be updated. |
|---|
| Contents: | Update function |
|---|
interface IRenderableObject
| Purpose: | An object that can be rendered |
|---|
| Contents: | Reference to a Graphic Resource through the Resource Manager
Render function |
|---|
class Player : IControllableObject
| Purpose: | Everything related to the player in the game |
|---|
interface IControllableObject
| Purpose: | An object that can be controlled by user input? |
|---|
class Menus
| Purpose: | For a system of menus. |
|---|
| Contents: | Menu collection
Current menu |
|---|
class Menu
| Purpose: | The stuff for a single menu screen. |
|---|
| Contents: | MenuObject collection |
|---|
class MenuObject
| Purpose: | Some sort of base class for menu items such as buttons, edit boxes, etc. |
|---|
There will be multiple tilesets used within a level?
Is IGameObject the same as I'm thinking for IUpdatableObject? IUpdatableObject can be used outside of the game though, such as for the menus.
I think we won't need a GameFrom class. A normal Windows.Form should be fine.
I know we need something for input, but that's not something I'm too familiar with.
Also I'm thinking the Game and Level objects should be both Updatables and Renderables.
__________________
<div style="float: right; width: 100px; height: 70px; margin: 5px 15px;"><img src="http://madskills.org/monolith/idleserver.gif" style="width: 98px; height: 65px;"><img src="http://madskills.org/monolith/theserver.gif" style="width: 98px; height: 65px; position: relative; top: -65px;"></div><div style="margin: 0 3em; font-size: 80%; font-style: italic;">Love is patient, love is kind. It does not envy, it does not boast, it is not proud. It is not rude, it is not self-seeking, it is not easily angered, it keeps no record of wrongs. Love does not delight in evil but rejoices with the truth. It always protects, always trusts, always hopes, always perseveres.</div><div style="text-align: right; text-size: 80%;">1 Corinthians 13:4-7</div>
|