void collision(int v)
{
collision_bug_one(0.0f, 10.0f);
glutPostRedisplay();
glutTimerFunc(1000, collision, 0);
}
void coll_sprite()
{
if (board[0][0] == 1)
{
collision(0);
flag[0][0] = 1;
}
}
void erase_sprite()
{
if (flag[0][0] == 1)
{
glColor3f(0.0f, 0.0f, 0.0f);
glBegin(GL_POLYGON);
glVertex3f(0.0f, 10.0f, 0.0f);
glVertex3f(0.0f, 9.0f, 0.0f);
glVertex3f(1.0f, 9.0f, 0.0f);
glVertex3f(1.0f, 10.0f, 0.0f);
glEnd();
}
}
I am using glutTimerFunc to wait a small amount of time to display a collision sprite before I black out the sprite. unfortunately my code only blacks out the said sprite without drawing the collision sprite, I have done a great deal of research on the glutTimerFunc and animation.