ok... so this is what I did:
Code:
class Shot
{
public:
void move();
bool collide();
protected:
POINT pos;
static HBITMAP image;
};
HBITMAP Shot::image;
But it tells me I just defined image multiple times.
So I looked at "Jamsa's C/C++/C# Programmer's bible", and it gave an example:
Code:
class Shot
{
static HBITMAP image;
public:
void move();
bool collide();
protected:
POINT pos;
};
HBITMAP Shot::image;
This worked, but then I tried to make a Bullet class that inherits from Shot:
Code:
class Bullet : public Shot
{
(...)
};
then in Bullet's constructor, when I tried accessing image, it said I couldn't access image because it was a private member of Shot. What am I doing wrong?
p.s. dunno why, but just a sec ago I tried putting the declaration in the protected section again, and then in Bullet's header, "HBITMAP Bullet::image;" and it worked. Why is this???