Project Your Turn


Project Your Turn is a turn-based strategy game that incorporates A* algorithm. The gameplay is simple - the player and the enemy take turns in controlling their units and fight it out in tactical battles. The project was made as an attempt to learn A* and control of multiple units.

Pathfinding


At the start of the game, a level grid is spawned. The grid positions are then dynamically allocated. The grid itself is made out of path nodes - each node has g, h, and f costs. A* algorithm is used to calculate the distance between every node and place them in worldspace. The movement is determined by the A* algorrithm and the Pathfinding checking to see if the grid is occupied during a turn.

Unit Manager

A class that keeps all track of the state of all the currently spawned units, whether the player has selected the unit, which team the unit belongs to, or if the unit has enough action points.

UnityManager3
UnityManager1
UnityManager2
BaseAction Class, part 2
Part 2 of the BaseAction - the class that every other class extends from.
BaseAction Class, part 1
Part 1 of the BaseAction - the class that every other class extends from.
InspectorView
InspectorView

Action System

A system of actions that the player or the enemy can do. Each action is extended from the BaseAction class and attached to the unit prefab.

See the Code on GitHub!