I'm making a space invaders clone using MinGW CodeBlocks on Windows 7. When compiling, I get this error:
C:\Users\Jim\Desktop\Programming\Face Invaders\invaders.h||In member function 'void invader0::spriteSetRect()':|
C:\Users\Jim\Desktop\Programming\Face Invaders\invaders.h|43|error: missing template arguments before '(' token|
C:\Users\Jim\Desktop\Programming\Face Invaders\invaders.h|44|error: missing template arguments before '(' token|
||=== Build finished: 2 errors, 0 warnings ===|
I'm guessing it has something to do with my class:
class invader0
{
private:
short posX, posY; // (0-800, 0-600)
static sf::Image Image0;
sf::Sprite Sprite;
public:
static bool state0; // (0-1)
void setPos(short, short);
static bool init (const std::string& ImageFile) {return Image0.LoadFromFile(ImageFile);}
invader0() {
Sprite.SetImage(Image0);
}
void spriteSetRect() {
if (state0 == 0) {
invader0::Sprite.SetSubRect(sf::Rect(0, 0, 16, 16)); // Error goes here
} else {invader0::Sprite.SetSubRect(sf::Rect(16, 0, 32, 16));}
}
};
Probably some simple mistake, but I can't think of what could be wrong.