Wagwun fellow developers
So I'm currently making an inventory system, but I realised that my method may be very inefficient to the performance of the game.
The general premise of the inventory is that it will be a slot-based system that will be stored via an Array. There will be MANY different items throughout the game that the player can collect, each with their own icon, but the inventory will only display about 16 items at a time.
The amount of items is definitely going to be 100+. Each icon will have the dimensions 32x32.
Now how do I display this and make adding items an easy task...
I have 2 ideas on how to display/create the icons for the items in the Array when I load them
A) (I'm currently doing this) Have all (100+) item icons of the items in one universal sprite called "Items", and name the animation whatever the item is, and display the animation according to what the item should be.
B) Create a separate sprite for each and every icon and add it into a universal family and individually code a "create" function for every object (as you cannot "Create object by name", which is why idea A is excellent, due to being able to choose the animation by name).
Now, I'm thinking that A) would mean that all of the items that exist in the game would be loaded all the time, which wouldn't be too nice on the VRAM. Whereas, B) would only load what is needed (I'm not entirely sure how C2 handles loading stuff)
However, B) is very long-winded and could potentially be BAD perhaps because there would be 100+ individual sprite objects. But A) Would be all self contained.
Thanks for reading!