Can anyone point me to a tutorial on making a skill or quick action bar? Like at the bottom of most MMO games or like Minecrafts item bar.
I was thinking 1 sprite repeated for each slot. Then give it instance varitables for all the possible skills?
The idea being you could customise the skills or actions you want to use. Usually with keyboard 1, 2, 3, etc.
Cheers!
Many different ways you can do this.
I usually use arrays for this, but i have done it mostly with inventories, but its the same concept.
What i do is i create an itemlist array with all the items that exist, they get an ID (usually the place they are assigned in the array).
Then i have another array for the actual player inventory, and when a player picks up an item it checks the itemlist array for what item, and pushes it to the inventory array.
To display the inventory, i have sprites, with different instance variable IDS, so 0,1,2,3 etc... If the item is in the first array slot, it will be displayed in the sprite with ID 0, if its 2th on the list it displays on sprite with Id 1 etc.
I usually match the frames/animations to the ID of the item, so animation is always set to display current item ID.
I can give you an example when i get home from work if you need 1!