Hi all, following my confusion in another thread of mine I feel like I need a bit of guidance before I delve any deeper into learning C++.
My intention in C++ is to build a game, but obviously not straight away. The game would include you the player as well as numerous different types of enemies (Think of something like Runescape for the purpose of the example).
The way I understood this to work was to have numerous classes, each representing a different enemy and each containing numerous variables (Hitpoints, weapons, name, damage bonuses for combat etc). However I've grown confused now that I'm putting it into practice. In terms of combat for example, the way I understood it to work was to reduce the remaining health of an enemy per attack, but how does this work if you only change the instance variable, does this not mean that at the start of every combat the enemy is returned to full health?
I'm just a bit confused on the basic structure of a game in C++, if anybody has any useful advice or tutorials in terms of this it would be great, I've had a Google round and followed a number of tutorials but each do things their own way, so I'm looking for a bit of personal experience.
Thanks very much!
My intention in C++ is to build a game, but obviously not straight away. The game would include you the player as well as numerous different types of enemies (Think of something like Runescape for the purpose of the example).
The way I understood this to work was to have numerous classes, each representing a different enemy and each containing numerous variables (Hitpoints, weapons, name, damage bonuses for combat etc). However I've grown confused now that I'm putting it into practice. In terms of combat for example, the way I understood it to work was to reduce the remaining health of an enemy per attack, but how does this work if you only change the instance variable, does this not mean that at the start of every combat the enemy is returned to full health?
I'm just a bit confused on the basic structure of a game in C++, if anybody has any useful advice or tutorials in terms of this it would be great, I've had a Google round and followed a number of tutorials but each do things their own way, so I'm looking for a bit of personal experience.
Thanks very much!