The High Ground

Programmer


Created and programmed/coded all aspects of the game, ranging from gameplay mechanics, user interface, and structural codebase.

  • Developed a “Cursor” system where the player can select, move, and view Unit stats.

  • Designed a three-dimensional map where the Unit’s height increases its attack value.

  • Utilized a modified Breadth First Search algorithm to view a Unit’s move and attack range.

  • Team: 2

  • Unity / C#

Key Components

Implementation

GameMaster.cs

  • Contains a two lists representing the Units of each Player.

  • Responsible for managing turn order and Player actions.

NavigationMap.cs

  • A 2D list representing the game board.

  • Initializes game board at the start of runtime.

Tile.cs

  • Multiple attributes retaining the Tile’s location, what is on and around the Tile.

    • AdjacencyList — A list of the adjacent tiles

    • visited — Boolean to know if the tile was visited by the B.F.S

    • distance — Integer representing the distance from the starting tile in B.F.S

    • marked — Boolean to enable the “Move” sprite (U.I. Element) indicating a Unit’s move range

    • unitLooking — Boolean to enable the “Attack” sprite (U.I. Element) indicating a Unit’s attack range

Cursor.cs

  • Handles selecting, moving, viewing, and navigating game board.

  • Encapsulates modified Breadth First Search algorithm.

Breadth First Search (Modified)

  • Breadth First Search is a pathfinding algorithm used to explore the nodes and edges of a graph, mainly to find the shortest path between two nodes.

  • Units are moved by player input through the Cursor, so B.F.S was modified to show the move and attack range of a unit.

Execution

  1. Each tile creates a list of its adjacent tiles.

  2. A Queue is initialized to record search order.

  3. Set the Unit’s tile (starting node) as visited.

  4. While the search Queue is not full:

    1. Dequeue the current tile.

    2. Set marked to true — enables “Move” Sprite on current tile.

    3. If the distance of the current tile is less then the Unit’s max “Move” value:

      1. Set visited to all adjacent to true.

      2. Add 1 plus the current tile’s distance.

      3. Add adjacent tiles to search Queue.

Code Snippet(s)

Cursor.cs — B.F.S Algorithm