I'm trying to write a simple class that represents a missile (for a game). It uses SFML 2.0 and the class is basically a sprite type. Now the only interface function that I want at the moment is the call to 'move'. This is a SFML function that is a member of the Sprite class. So my class inherits from sf::Sprite and sf::Texture.
This is what I have done in the file missile.h
class missile : public sf::Sprite, sf::Texture
// member functions - perform operations on data members
void move(float offsetX, float offsetY);
// encapsulated data members
static sf::Texture rocket_picture.loadFromFile("/home/neil/game/data/missile.png");
When i try to compile it i am getting these errors:
missile.h:15:22: error: expected ‘;’ at end of member declaration
missile.h:15:36: error: expected unqualified-id before ‘.’ token
missile.h:17:9: error: expected unqualified-id before ‘.’ token
missile.h:19:9: error: expected unqualified-id before ‘.’ token
I have tried making some changes to the data members. All the data does is setup the sprite. I tried copying the code i used in main to setup the sprite's image (that works) into the class - but it did not compile.
Basically i want an instance of this class to have the same image! I know it is simple but i am having trouble as i have not used this SFML before. Can anyone help me with this please?