Setting up our HUD
With side-scrolling shooter games, it is common for us to have some form of recording of how many lives the player has, what their score is, a time limit, power-ups, and more. We are going to apply a typical HUD to show a similar set of information. Knowing about HUDs is a requirement of the Unity Programmer Exam.
By the end of this section, we will have created a HUD for our game that will consist of the following:
- Lives
- Mini-map
- Score
Before we add our HUD, we need to decide where it will sit on top of our game screen. As an example, we will pick a game so that we can briefly study how its HUD information is displayed.
We will be looking at a game called Super R-Type, which can be found at https://github.com/PacktPublishing/Unity-Certified-Programmer-Exam-Guide-Second-Edition/blob/main/Chapter_09/superRtype.jpg. Here, at the bottom of the screen, we can see that its HUD is made up of four parts, as follows:
- Skill level
- Lives...