all I want to do is draw a animated sprite when a bullet hits a sprite. here is my collision detection function and my sprite drawing function all I need is a second pair of eyes to look at my code.
void drawcollision_one()
{
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, texture[3]);
glBegin(GL_POLYGON);
glTexCoord3f(0.0f + screen, 0.0f, 0.0f);
glVertex3f(10.0f, -10.0f, 0.0f);
glTexCoord3f(0.167f + screen, 0.0f, 0.0f);
glVertex3f(10.0f, 10.0f, 0.0f);
glTexCoord3f(0.167f + screen, 1.0f, 0.0f);
glVertex3f(-10.0f, 10.0f, 0.0f);
glTexCoord3f(0.0f + screen, 1.0f, 0.0f);
glVertex3f(-10.0f, -10.0f, 0.0f);
glEnd();
glDisable(GL_TEXTURE_2D);
}
void coll_plane_one()
{
//draw bullet
float x = -2.5f + move_plane;
float y = -75.0f + up;
float oWidth = 5.0f;
float oHeight = 5.0f;
//draw plane
float xTwo = -10.0f + move_plane;
float yTwo = 100.0f + down;
float oTwoWidth = 20.0f;
float oTwoHeight = 20.0f;
if (checkCollide(x, y, oWidth, oHeight, xTwo, yTwo, oTwoWidth, oTwoHeight) == 1)
{
drawcollision_one();
}
}