Stockpile Game Mode

Motivation

In our second Team Game Project, teams were required to make some variant of the Capture the Flag gametype. We prototyped a few different modes and ultimately decided that the classic Stockpile game mode would work best for our game.

Design

The stockpile game mode logic is split mainly across three classes: the game class, the flag class and the score zone class.
The game class manages the game timer, scoring timer and victory conditions for the game, but knows nothing about how points are scored.
The flag class manages the core gameplay, including attaching itself to the flag carriers and determining when the flag is in the correct location to score.
The score zone class mostly handles the visual effects that occur when the flag is placed and/or scores, but also functions as an attachable actor for the flag.