ColdCaseDocumentation Help

Game State Architecture

Our game world is divided into a grid of tiles. Each tile can contain an object, which we call a TileContent. The TileContent is a base class that all entities in the game world inherit from. A list of all TileContent's can be found here. This document will explain how the game state, containing all the TileContent objects, is managed and updated.

Game State

The game state is held in a 2D array of type tile, called the TileArray. Each tile can contain one TileContent object. Each TileContent can contain another Instance of TileContent, allowing for multiple objects on one tile. This achieves a hierarchical structure of the game world.

Accessed is this TileArray over the Map class, as shown in the class diagram below.

ColdCaseMapClassDiagramm-Page-1.drawio.svg

Class Documentation References

Summary of Class Interactions

  1. Map contains multiple Tile objects, forming the game grid.

  2. Specialized Tile types (EmptyTile, GroundTile) inherit from Tile.

  3. Each Tile can hold one TileContent, representing a new layer of the game world.

  4. Specialized TileContent types (Wall, Player, Goal) inherit from TileContent.

  5. TileContent Objects interact through actions and updates, supporting dynamic map changes ( see Interaction System).

Last modified: 14 February 2025