Get help using Construct 2

Post » Mon May 19, 2014 3:00 pm

Does anyone know the simplest way to create an inventory? I'm not very good with arrays but if there a simple way to do it I will try xD
Posts: 7
Reputation: 189

Post » Mon May 19, 2014 5:35 pm

I found that a dictionary is the best way to store and manage an inventory.
I have a sprite object with one animation and a frame for each inventory item.

when i want to add a new item to the inventory i add a key to the dictionary with the items name and the value is the animation frame for that object.

then i have a function that shows the inventory, I create a new item for each key on the dictionary set the name value to the key name and the animation frame to the key's value.

I don't keep any state of the item, if it changes (combine or what not) i just delete the old key and create a new one instead.
Posts: 525
Reputation: 13,109

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 3 guests