Creating MineField In Unity (Part 2)

Recently I made a simple MineSweeper-style game. Here’s how I made the Game Manager.

Vincent Taylor
Dec 10, 2021

Today’s Objective: Create the GameManager class which will handle all the game data not handled by a specific cell instance.

The Code:

First is to add some variables that I will need:

Also, the difficulty Enum system:

Now for the startup functions of the Manager:

The difficulty management functions:

The generation functions:

The gameplay functions:

That was a heap of code, but now I have a complete and nice game (excluding some miscellaneous game functions, like quitting)!

But after those are added and the game scene created, I’ve ended up with:

--

--

Vincent Taylor

Unity game developer / C# Programmer / Gamer. Australian (Tasmanian) indie games developer for 10+ years. Currently looking for games industry employment.