SIMPLE MAZE GAME

 


Now that we have learned most of the basics of using Unity, we will try to apply these concepts and make a simple maze game.

Layout your desired maze design. It should have a player, enemies, hearts, two canvas texts containing "GAME OVER" and "SAVE", and a life display at the upper center. Example below.



Now for the scripts:

PLAYER. Player Script and Life Script.

Player Script

Life Script


ENEMIES. Assign positions for the movement of the enemies in the game. Done previously in this lesson. Refer to the robber movement.

HEARTS. Create a parent for the hearts. This is where we will add the Life Counter Script.

6 hearts. 3 for the actual maze. another 3 for the life display.


Life Counter Script


And we're done. Just make sure to assign all Game Objects to its corresponding variables (look at the Inspector Panel) to make the script function accordingly.

The game should look like this.


Comments