Architecture

The main elements include the Game, Actor, Block and Level classes.

The Game class

The Game class contains all the information needed to edit and play a game. This includes references to all the Actors, Blocks and Levels. It also contains global information such as the name of the game, the name of the author, etc.

The Actor class

The actor class represents moving elements in a game whether they be the player character, enemies, missles, moving platforms, etc. Actors have references to graphics, sounds and other properties that define how it interacts with other elements of the game including scenery blocks and other actors.

The Block class

The Block class represents stationary elements in a level or game. Although they cannot move, they can switch between different types of blocks. They also have properties that allow them to shoot, act as ladders if the level has gravity, kill actors, award extra lives or points, etc.

The Level class

The Level class represents a level in a game. Each level is made up of a two dimensional array of blocks. Levels also hold the starting positions of actors, environmental properties such as gravity, etc.

SourceForge.net Logo