Components Diagram




NOTE: All lines in the diagram above represent a "has-a" relationship. For instance, the Universe has a World. All relationships are 1:1. This means that there is only one instance of this component in the project. There are two notable exceptions to this general rule: (1) the world contains many entities and (2) the update queue can contain zero, one, or many events.

Win Main - This is the mandatory entry point for a windows application. This is very lean on purpose. All it does is create an instance of the Universe and run it.

Universe - The Universe owns everything. This is really mostly just a conceptual entity. The implementation only entails instantiating and initializing the other components.

World - Represents the "state" of the game. Previously called the Object Store. Maintains all information about the game world. Contains many entities. Contains the Update Queue. The world has width and height. The current width and height are 3072 by 3200 pixels respectively.

Entity - the base-line object in the game. An entity can be a non-animated tile, a non-animated & non-moving object, an animated & non-moving object, or a an animated & moving object. Every entity has a graphic which contains all of the animation frames to animate a sequence or a single frame depending on the type of the entity. Currently, there are no entities that do not have a graphic (although this might change). When an entity is updated, it determines if its graphic is in the view. If the graphic is in the view, then it will add an event to the Update Queue. Currently responsible for clipping its graphic (but this functionality might move to the engine).

Graphic - either a single frame or an animation sequence of many frames. All graphics are stored on disk as 24-bit color BMPs. They are displayed on the screen in 16-bit color.

Update Queue - holds events that will affect the current view (i.e., graphics that need to be blitted to the back buffer). Entities enqueue events on the Update Queue. The Engine dequeues events from the Queue and blits them to the buffer.

Event - a structure class that contains the X and Y screen coordinates, the clipped grapihcs rectangle info, and the DirectDraw surface that contains the image to be blitted.

View - a subset of the coordinates of the world. The view represents that portion of the world that should appear on the screen.

Engine - 2D graphics engine; pretty much just a wrapper for the DirectDraw COM object.

Control - Not implemented yet. Eventually will contain the main game loop. Responsible for the flow of control through the program.

Input - Not implemented yet. Responsible for receiving and queing input events. Probably will end up being an interface for DirectInput.

Enemy AI - Not implemented yet. Responsible for moving all non-human player controlled entities.

Sound - Not implemented yet. Responsible for sending sound events. Probably will end up being an interface for DirectSound.

Message Handler - Windows message handler. Bare-bones implementation. Not used yet.

Network - Not implemented yet. Reponsible for networking events.

Clock - Not implemented yet (although a bare bones OS timer is) - Handles game time.

Status:
18 JUL 01 - Display one sprite on a page flipping surface in DirectDraw
28 JUL 01 - Use transparent source blitting color for BMP.
28 JUL 01 - Move one unclipped sprite.
29 JUL 01 - Move one clipped sprite.
29 JUL 01 - Implement event queue.
               - Animate stationary sprite.
               - Animate moving sprite.
               - Display tiled map.
               - Scroll tiled map.
               - Move sprite on stationary tiled map.
               - Move sprite on moving tiled map.
               - Implement Input component.
               - Implement mini-map.
               - Implement status-bar.
               - Implement queuing area.
               - Implement building options.