this is a C# sript that is intended to be used as an asset in a Unity game environment
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Pan’s Labyrinth


Labyrinths have taken on a number of meanings throughout history – e.g. devotion, power, games. The first recorded labyrinth dates back to Egypt at the time of king Amenemhet 1842 - 1797 BCE. In my work I was particularly drawn to garden mazes. While the devotional varieties of such mazes have proliferated since the 13th century, secular garden mazes initially appeared as derivative of small artificial hills during the Renaissance and gaining greater popularity in 15th Century France. Often elaborate in their nature, they espoused equal portions of fun and complexity.

Developed in Unity, using C#, Pan’s Labyrinth merges the histrorical context of a labyrinth with the simplicity of children's games.

Technical notes

Using object oriented programming, I create a maze object containing cells, each with three open walls, and one wall that is closed off. The cells also have an indication of the four neighbors and whether passage to them is opened or closed.

Once the maze object is generated it becomes possible to assess which cells are connected. To do so, I pick a random first cell and examine its neighbors, then its neighbors' neighbors, etc. with -1 serving as an indicator of inaccessibility. I then apply a variation of Dijkstra's algorithm to find the shortest path from the first cell to the one farthest away (i.e. the cell with the highest cost).


Here is a trailer featuring the final game play: **
video **Note: the C# script corresponds to an earlier, simpler version of the game