You have declared a bunch of functions in the class, but not defined them anywhere. This is true for all of your classes. You need to define them like this, for example, and outside the class:
1 2 3
|
int Monster::GetMonster_Health() {
//your code here
}
|
Normally one has the class declarations in their own header file (Monster.h say) and the function definitions in an implementation file (Monster.cpp say).
There are a couple of naming conventions that are reasonably standard but personal preference. Put a leading m_ on all al the class member variables - this helps you to realise it's a member variable, which can be handy sometimes. I put a leasing 'C' on my class names - such as CMonster say.
Also try to avoid having a get & set function for every class variable. We have just had a huge discussion about this here:
At your level of programming, I don't have a problem with get functions, but the biggest problem is the set functions - you wouldn't allow anyone to set your real world bank balance to 0.00 would you ?
Instead think about why you need to change the value. You could for example have an ApplyDamage class function instead, as a very simple alternative. At least this way you are not blindly setting the value of m_Health, you are applying a damage value to it:
m_Health -= TheDamage;
And you have the opportunity to doing checking.
Even better, have a SendDamage function in each object that is doing damage to something, and have a ReceiveDamage function in each object that is having damage done to it. The SendDamage function calls the other object's ReceiveDamage function, with the amount of damage as an argument. The ReceiveDamage function uses that information to apply damage to the m_Health variable. No need for the ApplyDamage function in this scenario, class member functions have direct access to class member variables.
That way, you are hiding the internal details of your class from the outside world - which is a good thing.
Also try to learn about constructors & initialiser lists.
With your function names, I personally would not have 'Monster' in all the Monster function names, because you already have it in the object variable name, and it makes everything too long.
Hope all goes well :)