problem with classes and pointers
WARNING: Not very clean code xP
Well, I have this class called player.
Code:
class player : public character{
public:
player();
~player();
float speed;
private:
//hgeQuad
};
And then I have this class called character.
Code:
class character {
public:
character();
~character();
float x, y;
static const int gravityPull = 1;
void gravity();
bool gravEffected();
};
And in the main.cpp file I call player* P1, this crashes the game, and I've had laods of problems, when I call it as a pointer, but not when I call it like; player P1, why is this?
I still havn't figured out the differences between the two calls...
The thing I'm having problem with is the x and y from character, by the way.
Thanks in advance :)