Collectables and items
I know, we saw this element more than one time in this book but, hey, this is a very common element in a lot of games.
In a survival world, you must be able to interact with most of the elements around you. You want to collect stones, wood, grass, or fruits and be able to craft your tools, such as axes to cut the trees. You would also want weapons to hunt your food in order to survive in the hostile environment.
In this section, we will create an inventory system for the objects that can be collected in the world: we will use a new element (structure) that handles the properties of our items. We improve our knowledge of Blueprint wizard to populate a useful and dynamic user interface, and we will see how useful Blueprint Interfaces and superclasses are when talking about a vast number of different interactive objects and a crafting system.
Blueprint structures
A Blueprint structure is exactly like a structure of an object-oriented programming language: a special variable...