ok just needed some help with some logic that was giving me a bit of trouble. Ok so Im in the midst of making a platformer sidescroller but im not sure how to handle multiple weapon's amunition, clips. I know that a messy way would be assigning individual variables for each thing such as a pistols ammo and clips but is there a way to compile that in an easier way.
heres a basic example of my logic berrettabullets:number = 9; berrettaclips:number = 2; and so on for other guns is there an easier way?
i would probably go about this by using a Class for each weapon type that extends a base weapon class - then assign the property within each sub-class - this way all other references to any weapon are 'generic' and the property is always available for use by other calling methods.
Umm... what whiteperson? However, I think beech was right, make a weapon class with all the vars and the basic code and then extend the weapon classes to it. Probably it will be useful to do it for the bullets classes too, because I think the movement code for them will be quite the same.