I made a couple projects to test basic player inventory systems. I noticed there are a few posts on the forum about this kind of thing already, but I felt like playing around and just seeing what I could come up with off the top of my head. So far I made two different types, and I might make more variations later if I feel like it.
*Edit:Added a third type
Type 1:
inventory-type-1.wick (19.6 KB)
Notes
- Each space stores one item
- New items are added to the end of the inventory
- Every time you use up an item, remaining items are shifted left
- Some items can only be used under certain conditions (also true for type 2)
Type 2:
inventory-type-2.wick (20.3 KB)
Notes
- Each space stores one type of item
- Each item has a max storage of 99
- Some items can only be used under certain conditions (also true for type 1)
Type 3
inventory-type-2-select.wick (26.3 KB)
Notes
- Same as type 2, but when you click an item in the inventory, it goes to the mouse cursor. Then you click on what you want to use that item on. If you click on nothing, or you click on something that the item can’t be used for, the item returns to your inventory.
You can use/adapt what’s here for your own projects if you’d like. Disclaimer that this is just an experiment, I don’t know how well these would work if implemented into a larger, more complex game. On a side note, since I was focused on the inventory stuff, I didn’t really polish the other aspects of these projects yet. (The one thing that’ll probably seem weird is that items that the player can pick up will spawn on top of each other sometimes. This is because I just randomized their positions without checking for collisions.)