I have a setup something along the lines of this. Multiple levels of inheritance from a single base class containing a protected member x.
class Sprite {
protected:
float x, y;
}
class AnimatedSprite : Sprite {
public:
void draw(float x, float y);
}
class Player : AnimatedSprite {
public:
void draw(float x, float y);
}
The implementation for the method draw in derived class Player is something along these lines.
void Player::draw(float x, float y) {
AnimatedSprite::draw(this->x, this->y);
}
However compiler is complaining that members x and y are inaccessible, even though they are listed as protected in the base class.