• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Item System Help?

Tech-Mo

Member
I'm trying to have an item system where when you pickup an item's instance in the game's overworld it appears in a special HUD. The way the HUD works is that you can use Q and E to switch through the items that you're currently holding and P to equip/use it. I've tried using an item id system but nothing seemed to work at all. Does anyone have an idea on how I can achieve this HUD?

spr_itemgauge_0.png
 
Last edited:
D

Danei

Guest
You could keep a DS_list for your inventory and when you pick up an item, add it into your list in some way. I would just use the sprite index of the item, unless you have multiple items with the same index, in which case you could use strings or enums which you link to sprites. Use a variable that cycles up or down with Q and E to track which list index you're currently selecting. You'll need to do some extra management if you want to limit the size of your inventory of course. Then use draw functions to draw the sprites from the list that you want to see on the screen at a given time.
When you hit P, you can use a switch to perform the correct effects for using/equipping that particular item you are selecting.
 
Top