I am an AS3 novice and I am working on my first game.
So I have an Array of troops, that will be added when purchased from the store.
public var myTroops: Array = [{type: "lightInfantry", hp: "100", def: "10"},
{type: "lightInfantry", hp: "100", def: "10"},
{type: "heavyInfantry", hp: "100", def: "10"}];
I need to find how many times a certain type of infantry occurs and then trace it back, I have found other questions asking for help, but not for multi-arrays. How would I get this? Basically asking for some help in how to write the code for returning how many of each infantry the player already has.
Tips and answered are greatly appreciated. Thanks in advance.