Hello everyone. This thread is about my new game, "Micro Wars". I'll post screenshots and give more details about the game at a later date, if there is interest. However, the main purpose of this thread is so that you wonderful people can help me with various bugs.
The first one I'm having is this
[Linker error] undefined reference to `vtable for PROJECTILE'
Without a line-number it makes it a touch hard to debug.
The class:
class PROJECTILE
{
public:
int parent;
bool del;
static void handle();
virtual void step();
virtual void draw();
};
Defined as: list<PROJECTILE> projectile;
A function:
void PROJECTILE::handle()
{
for( list<PROJECTILE>::iterator current = projectile.begin(); current != projectile.end(); current++ )
{
current->step();
if( current->del )
{
current = projectile.erase(current);
continue;
}
current->draw();
}
}
Where it's used: projectile.push_back(BULLET(id, px, py, 300, dir));
And the bullet:
class BULLET : public PROJECTILE
{
public:
float x1, y1, x2, y2, lx, ly;
float vel, dir;
BULLET(int p, float px, float py, float v, float d);
void step();
void draw();
bool hit_map(int r);
};
Any ideas what may be causing the problem?