Hello, I'm looking for a bit of help with keeping my code from having to be repeated multiple times (possibly using Families?). My game is going to have multiple kinds of enemies, and different types of projectiles the player can fire, with a few shared variables between all of them. Every bullet has a 'DamageDealt' instance variable, and every enemy has a 'CurrentHealth' variable, and so on. The way I have it set up now is as such:
The problem is that I don't know how to avoid repeating this code for each type of bullet and then repeating that for each type of enemy. How would I go about doing that? I tried using families, but I can't figure out how to address the instance variables of something in the family, only the family itself.