我在下面的代码片段中得到了5个错误
其中4个错误是
expected unqualified-id before ( token|
和1个错误
GetEntityIterator was not declared in this scope|
GetEntityIterator()
返回向量<*实体>;:迭代器EntityIterator
GetAABB()
返回AABB
如果需要,我可以发布更多代码
void Bomb::CreateExplosion(Game_Manager* EGame_Manager)
{
BombTexture->LoadTexture("Bomb.bmp");
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
for(int iteration = 1; iteration <= 3; iteration++)
{
if(this->GetAABB()->CheckForCollision(this->GetAABB(), EGame_Manager->getEntityManager()->(*GetEntityIterator())->GetAABB()) == true)//check for collision against the unbreakable blocks or player and does what is necessary for each
{
if(EGame_Manager->getEntityManager()->(*GetEntityIterator())->GetType() == unbreakableblock)
{
break;
}
else if(EGame_Manager->getEntityManager()->(*GetEntityIterator())->GetType() == player)
{
EGame_Manager->getEntityManager()->(*GetEntityIterator())->GetLives() -= 1;
}
}
else
glBegin(GL_QUADS);
glColor4f( 1.0f, 0.0f, 0.0f, 0.0f); //color red
glTexCoord2f(0.0, 0.0); //uv coordinates
glVertex3f( -2.0f + x,2.0f + y, 0.0f); //top left
//----------------------------------------------------
glColor4f( 0.0f, 1.0f, 0.0f, 0.0f); //color green
glTexCoord2f(1, 0.0 ); //uv coordinates
glVertex3f( 2.0f + x,2.0f + y, 0.0f); //top right
//----------------------------------------------------
glColor4f( 0.0f, 0.0f, 1.0f, 0.0f); //color blue
glTexCoord2f(1, 1);
glVertex3f( 2.0f + x, -2.0f + y, 0.0f); //bottom right
//----------------------------------------------------
glColor4f( 1.0f, 1.0f, 0.0f, 0.0f); //color red
glTexCoord2f(0.0, 1); //uv coordinates
glVertex3f(-2.0f + x, -2.0f + y, 0.0f); //bottom left
glEnd();
}
glDisable(GL_TEXTURE_2D); //disable 2d textures
}