Chapter 6. Collection, Inventory, and HUD
Working with a similar approach to the previous chapter, in this chapter we will be continuing our use of trigger collision detection, this time using it to pick up objects. We will then move on to look at creating parts of a 2D Heads Up Display (HUD) and how we can control these, as well as the environment, through code.
A HUD in video games varies between differing genres; in a racing game for example, the HUD would be elements such as your speed, position, remaining laps, and so on.
In a first person shooter your HUD is more likely to be made up of elements such as health, ammunition, and inventory items.
As we have already set up an outpost with an opening door, we will now restrict player access by making them find objects in order to open the door. By showing on-screen instructions when the player enters the outpost door's trigger zone, we will inform them that the door...