Greetings, I've tried to look this up and was pointed to the JSON plugin, but I'm having a bit of a problem comprehending how I want to use all this.
Basically, my inventory screen allows the items to be dragged and dropped, right now I have one Item object and then it has an instance variable to tell it what item it is.
Now I can do the basic programming for each object, i.e. when candle hits sword it becomes a fire sword. (when object 1=2 destroy and create object 3) and that works. What I need help with is how I want to set up my arrays. I'm assuming I should use a JSON file or WebStorage and I've read the book about them but am still confused.
So here's the stats I'm storing Item Number, Item Name (Which is how it pulls up the animation as well), HP+, Move speed+, Damage+ , Defense+ and also In Inventory (to populate the inventory list). Then I also need to store what the item is combining with (I.e 1+2=3) Then I also need to store any class changes that this item makes when attaching to a character with a previous class (I.e Sword + Worker = Soldier, Bounty + Worker = Mercenary)
So here's where I'm confused, How do I store that this item mixed with another item equals the third item? Like I set a new object in the Candle object called mix, the item i want it to mix with is ID 1, so I'd assume I set 1 as a variable (Set 1 at current@ "FireSword") then I'm drawing a blank. I know when those two items touch I want to check this database at the position of MIX... (While writing this I was just thinking maybe I should pull the Mixing out and make it it's own thing, then I can be like, 0 and 1 make 2? I don't ever have to save these combinations outside of a play game so should I even be using JSON? The only stats I'm saving as #PC (four playable characters at a time) their race and their class and their current item (only one item at a time)
IDK I'm getting really confused and I think I'm just over thinking this.
So yeah that's the main question, then of coarse am I using my arrays correctly and am I using the right arrays? Right now all my races are in a single array with X the name, Y the base HP and Z the base move speed, and that works well. I realize I only really need to save my one array for the characters, and am still looking into the best way to do that as well so any pointing me in the right direction for a small mobile game would be awesome.
Anyways thank you for any response introspect or tutorial you could point me in the direction of. Basically it's a tactics game with a alchemy type leveling system.