I could really use some help with creating an inventory system for an ‘escape the room’ type of game I’m trying to create. I’ve gotten the basic structure of the game done but am really struggling with how to apply an interactive inventory.
What I’m trying to do is when a player clicks on a pickable item, the item moves into the inventory slot located at the bottom of the screen. I then want the player to be able to either select the item in the inventory in order to use it (for example, select a crowbar to open a crate which contains a key, then the player can pick up the key, which goes into the inventory, in order to open a door to escape). It sounds simple, but I’m really struggling, even after doing some research and hours of trail and error. I’ve toyed with global variables, but no luck.
Can anyone help, preferably with images of code so I can understand how to do it.
Some examples of the type of game I am trying to create is below:
P.S. not to complicate the question but IF its easy to do, I’d like to make the inventory item draggable onto the screen so the player can test inventory items on other things (such as drag the crowbar from inventory onto the crate in order to open it).
Thanks in advance for any help you can offer!