The CSS Game Project
Object Model Revised


Schedules | Members | Resources | Tools | Assignments | Message Boards
Story | Screenshots | Downloads | Objective | Home


The variables of the game are loaded as a whole since events can trigger across levels. However, the game is loaded one level at a time. This is where all the heavy hitting information come in.

Let us start by seeing what types of objects are in the game:

It also becomes quickly apparent that any object can carry other objects with it. For example, the character may have certain tools, weapons, events, etc.

A Character has:
Properties:

Tools:

A Tool/PowerUp has:

A Weapon has:

  • Attack points
  • GetAttackPoints()
  • Name
  • GetName()
  • Position
  • Velocity

    All of these above (Character,Weapon,Tool,PowerUp) inherit from the LevelElement. In addition, walls, floors, and even empty space inherit from the LevelEement.

    The LevelElement itself also has properties and methods:

    The Level is an object:

    There are also methods on the Game plane:

    We have a level which we will call the CURRENT_WORLD. The current world is represented by a two dimensional array of LevelElements (or actually pointers to LevelElements). Remember, a LevelElement is any weapon, tool, wall, character, etc. Any cell can contain any LevelElement. A LevelElement can take up any number of cells. Each LevelElement is a smart object, in that it knows what grid coordinates it sits in and where it exists in three dimensional space (or possibly just the latter). Now, a LevelElement doesn't necessarily have to move, as a wall will always sit in the same grid points. We do not allow multiple objects in the same grid space. Several grid spots will often point to the same object.

    In addition to this, it was decided that we would separate and encapsulate parts of the system to maximize understandability.
    A control system will run all internal properties and methods of the system. When there is need to display information, it sends the proper commands to a graphics system, which will in turn, pull graphical information from cached data. On the other hand, the control system could just as easily send information to a text system which will manually print out changes.