Hello, for my final team project for C++ we are making a simple space invaders clone with the SDL libraries.
Most of it is working great so far but in order to 'destroy' the enemies, they must not be drawn anymore and should be destructed.
ER is just the # of rows, same with EC - columns
Now the problem I'm having is when checking if(!enemies[r][c]==NULL)
which tells me:
error C2676: binary '==' : 'Enemy' does not define this operator or a conversion to a type acceptable to the predefined operator
// Show new enemy locations
for(int r=0; r<ER; r++)
{
for(int c=0; c<EC; c++)
{
if(!enemies[r][c]==NULL)
// Shows each enemy at their specific locations
apply_surface(enemies[r][c].x,enemies[r][c].y,enemySprite,screen);
}
}
I figured that maybe I might have to try and overload the == operator but I'm not even sure if that's the right step nor do I know how to do it properly.
Any help appreciated, thanks.