Hi, I have 3 classes. Parent class is Sprite.
It goes like this:
1 2 3 4
|
class Sprite
{
...
}
|
1 2 3 4
|
class WorldOBJ: public Sprite
{
...
}
|
1 2 3 4
|
class Player: public WorldOBJ
{
...
}
|
The problem is, I cannot access methods that are in Sprite class from either other class. I have #include "Sprite.h" in WorldOBJ and #include "WorldOBJ.h" in Player class.
So, What I mean is, in my main.cpp, I create a Player like so:
Player g_player;
I then try to call a Sprite function like so:
g_player.setSprite("blah.png");
I get the following error:
main.cpp|25|error: expected constructor, destructor, or type conversion before ‘.’ token|
Is it possible to have 3 levels of inheritance like I have? What am I doing wrong?