In the game I'm making the player will get many different weapons. The easiest way to manage a lot of weapons with minimal coding is to put something to use as an object that will not be deleted in a family and give the family instance variables like; damage, clip, ammo, fire rate, reloading, active, etc.
What happens is when you select a weapon it deletes all the weapon sprites and spawns in the selected sprite and sets the "data holding objects" active variable to 1 and all others to 0. Then I can just use 1 template for all the weapons but it needs to detect which weapons is active and use its stats.
I have done this before but I deleted it, now I need it again and I can't work it out.
Shortened: test for which weapon is active and use its variables. But it needs to select one from multiple objects with the same instance variables by seeing which one is 'active'.
Thank you to anyone who can help me, or anyone who can figure out an easier way.