I'm doing a simple " space invaders" game in OpenGl and in the part of the collisions I need to calculate the minimum and maximum X and Y values, but I still can not figure out how to do this.
This is the code I use to create an enemy ship:
void Inimiga::Corpo(void){
glColor3f(0.545, 0.000, 0.000);
glScalef(1.0,0.5,0.0);
glBegin(GL_QUADS);{
glVertex2f(0.0,0.0);
glVertex2f(0.8,0.0);
glVertex2f(0.8,0.25);
glVertex2f(0.0,0.25);
}
glEnd();
}
void Inimiga::asaDireita(void){
glColor3f(0.545, 0.000, 0.000);
glScalef(0.5,1.0,0.0);
glBegin(GL_TRIANGLES);{
glVertex2f(0.0,0.0);
glVertex2f(2.0,1.0);
glVertex2f(0.0,2.0);
}
glEnd();
}
void Inimiga::asaEsquerda(void){
glColor3f(0.545, 0.000, 0.000);
glScalef(0.5,1.0,0.0);
glBegin(GL_TRIANGLES);{
glVertex2f(0.0,1.0);
glVertex2f(2.0,0.0);
glVertex2f(2.0,2.0);
}
glEnd();
}