woad
June 17th, 2006, 07:54 PM
So, i'm making a military command type game and I'm using arrays to hold what's in the armies of the game. So let's say there's a unit array of all the different units in my army. Units = ["Pikemen", "Swordsmen"] . How would I give properties to one of them? Say I need to change the amount of swordsmen I have after a battle and also give them more experience.
Would it be something like units[1].exp += 50 ?
Or maybe, should I not be using arrays at all?
Would it be something like units[1].exp += 50 ?
Or maybe, should I not be using arrays at all?