Dash

Repository

Dash is a top-down tank-based combat game, based on the Tanks! minigame from Wii Play. It's written in C++, using CMake and SFML. I implemented my own collision and pathfinding logic.

In Dash, the player must fight enemy tanks in a series of missions, where each mission has a unique map, and more difficult enemy tanks are introduced as the missions progress. The game ends if the player completes all twenty missions or loses all their lives. Points are earned for destroying enemy tanks, and high scores are tracked in a persistant leaderboard.

The mission layouts are loaded from data files on disk, where the layout itself is 'drawn' using ASCII characters. This provides an intuitive authoring process, making it easy to create and modify missions. The rendering logic is fully responsive, allowing the game to be played at any resolution.

screenshot of Dash gameplay

Design

Before I began programming, I wrote several paragraphs detailing each aspect of the game, including game mechanics, user interactions, and AI behaviours. From these paragraphs, I derived a series of classes that would satisfy the requirements, illustrating their relationships in a class diagram. This allowed me to refine the structure of the program before I'd written any code, reducing the need to refactor it after it was written.

screenshot of the Dash design document
diagram illustrating the class relationships in Dash

Implementation

Interestingly, for this project, I spent a significant amount of time learning CMake, which proved somewhat challenging due to a lack of documentation. However, I was still able to construct a configuration that provides dependency management, code formatting, resource bundling, and unit testing. This process was made easier by my prior experience with similar tools in web projects.

For the game itself, I implemented my own version of the A* pathfinding algorithm, which allowed me to create enemy tanks that could react to changes in the mission layout as walls were destroyed. This process helped reinforce my knowledge of data structures and the logic behind efficient search algorithms.

screenshot of the Dash title screen
screenshot of Dash gameplay