I can't seem to get my inventory to work properly. I have managed to get a HUD layer going with a lifebar and a slot for weapons, I can pick them up and use them, but I get a bit confused when it comes to setting up the variables.
This is how I currently have it set up:
On the HUD, I have a sprite with frames for each weapon
The player has instance variables:
And the crates are just sprites that when the player collides with for example the gun crate the player instance variable Gun is set to 1 and the gunslot is set to 1.
What is not happening that you are expecting to happen? Also for less risk I would use global variables instead of instance variable on the player object for any inventory.
Develop games in your browser. Powerful, performant & highly capable.
I had issues being able to scroll between weapons in the inventory. I managed to get it working with global variables as you suggested. Heh, I need to remember to use globals more =)