Hi all. Can someone please help me in figuring this out?
Okay, so I have an enemy family, the family has a family instance variable of "HP" and I've set it to 100.
I have a bunch of enemies in one layout and when damaged the HP value changes individually for each one, perfect so far.
If I leave the layout however, and then come back to it later their health values reset to 100. I don't want that, I want the damage each of them took to persist between layouts...but family instance variables aren't static, and it doesn't seem that they can be set to be static either. I mean, I think I understand why they can't be static but I'm not sure what else to try now.
Global variables don't make a whole lot of sense for multiple enemies of the same type, right? And local variables have always confused me a bit to be honest and I'm not sure how to implement something like that anyway.
Any solution to this problem? Thanks for any help.