top of page

Turnbased Roguelike

Made in Unity with C#
Role: Programmer

Team size: 2

Time: 2 weeks

Small project I made in "Game Programming with C#" at Futuregames together with another programmer, Emil Sundman. We mostly worked on separate stuff but helped eachother when there was any problems.

Enemy Pathfinding

Implemented my own implementation of A* pathfinding with a method that takes a grid of tiles, start- and end positions to calculate the path and return a list of tile positions. The Tile class contains an enum to check if characters can walk on it.

Entities

The Player and Enemy classes inherit from the Entity base class to share behaviour such as movement, attacks and simple animations through code. The difference in the classes is that the Player can equip weapons, earn gold and interact with store tiles whereas Enemy contains behaviour logic to act based on a few rules:

  1. Attack if the player is in attack range.

  2. Move towards the player if the player is in chase range.

  3. Move in a random direction.

Turnbased System

To make the game turnbased I made controller classes for the player and enemies. The Player Controller reads user input and the Enemy Controller simply tells each Enemy one at a time to make their move. When a controller finishes a move it gives control to the other controller.

q240doi.png
bottom of page