struct Ball {
SDL_Surface *picture;
SDL_Rect des;
SDL_Rect source;
int speedX;
int speedY;
};
class Block {
public:
SDL_Surface *color;
SDL_Rect des;
SDL_Rect source;
bool activation;
bool invisibility;
bool checkHit (Ball *ball);
void makeInvisible();
};
bool Block::checkHit(Ball *ball)
{
if (activation)
{
if (ball->des.x >= Block.des.x && ball->des.x <= Block.des.x + Block.source.w)
{
ball->speedY *= -1;
activation = false;
return true;
}
else return false;
}
}
このプログラムをコンパイルしようとすると、コンパイラは Block::checkHit error C2275: 'Block' : illegal use of this type as an expression でエラーを検出します
私に何ができる ?