It keeps saying "Class Troll does not have any field named Health"
But, I inherited BaseEnemy within Troll which DOES have a short Health and a short AttackMag.
The class Troll does not have it's own Health but BaseEnemy does and BaseEnemy is the base of Troll.
#ifndef BASEENEMY_H
#define BASEENEMY_H
class Player;
class BaseEnemy
{
public:
BaseEnemy(short h, short a);
short Health;
short AttackMag;
virtualvoid Attack(Player &);
};
#endif // BASEENEMY_H
The reason why it took me so long to solve this was because I never knew about the "calling the base constructor" thing. I researched a lot and finally I stumbled across it after a few hours.