A simple Pac-Man clone made with Unity and C#.
The level is defined by an matrix where each position represents a position in the board.
Walls are then created by analising the matrix and selecting which wall piece to instantiate acording to its neighbors from a collection of six pieces:
That way I could very easily create new levels or implement a procedural level generator. Here is a different level to illustrate the possibility: