For the player to beat the game and escape the tunnels of the Sanatorium, they must collect notes found throughout the map. Once all are collected, the exit will unlock and they can escape.
In order to achieve this, I created a simple note game object and applied the Unity script for rotation on the Y axis, to make it spin slowly for a more interesting collectable:
With the note spinning, it was time to make it function with the player and the door. I created a note pickup script that, if all notes are picked up, displays a UI panel letting the player know they are all collected, and unlocks the door through a connecting Boolean:
This is the script for note collection.
This is the door script, which shows UI text saying "Exit Locked" if not all the notes are collected, and allows the next scene to load if all notes are collected.
The next scene is a transition scene which congratulates the player for escaping the tunnels, and allows the player to press a continue button, which loads into the next level, the hospital. Here is the transition screen:
Comments
Post a Comment