If I want to use a function to modify Enemy.HP, but have it written as above, how would I do that? I want to keep Enemy.HP private because I feel like that's the 'right' way to do it, but the only way I can come up to work that out is doing it backwards (i.e Enemy.takeDMG(Player.dmg)-type thing).
The attack function itself would just subtract the Player.dmg int from Enemy.HP. What's the easiest way to accomplish this?
Yes. Make a TakeDamage() function. If the player receiving the damage has defense bonuses, you can calculate them inside this function, making the thing more transparent.
I always liked working on programs like this when I was learning, this is a great chance to work on your inheritance/polymorphism knowledge. Meaning something like TakeDamage seems like it would be good for players as well, having their own implementation (or same) as an Enemy object. Sounds like the workings for a base class interface.
Great point. If you have any knowledge of inheritance, now would be a good time to think about using it. A game object class can be a great superclass for players/enemies/static objects as they'll all probably contain similar Draw() and Update() functions.
Couple that with a collection class and drawing objects becomes as simple as a loop with a single line in it. Nice stuff.