Creating and displaying an inventory system
In our game, in addition to med packs, we will be able to collect other types of objects. We will then need to keep track of these objects using variables and graphical representations. This can be done using a basic inventory system. Some objects will have an effect on the player (for example, increase health), while other objects will be used at a later stage. To keep track of these objects we will need to create corresponding variables, update these variables when the corresponding objects have been collected, display a graphical representation of the object(s) collected, and modify the players' attributes (for example,
its health). We will be working with the script
collisionDetection. First, let's ...