well I have solved my problem thanks for all the help
breakout game scoring
well I have solved my problem thanks for all the help
Please provide the solution, so the next guy with the same problem and can learn from it. Thanks :)
here is my solution
void
drawBitmapText(char *string,float x,float y,float z)
{
char
*c;
glPushAttrib(
GL_CURRENT_BIT);
glClear(
GL_COLOR_BUFFER_BIT);
brick();
paddle();
ball();
glColor3f(1.0f,1.0f,1.0f);
glRasterPos3f(
x, y,z);
for
(c=string; *c != '\0'; c++)
{
glutBitmapCharacter(
GLUT_BITMAP_TIMES_ROMAN_24, *c);
}
glPopAttrib();
}
void
brick_collision()
{
GLint n=0;
if(bricks[2][4]==true)
{
n+=100;
str=itoa(n,buffer,10);
drawBitmapText(str,0.0f,2.0f,0.0f);
}
if(bricks[2][3]==true)
{
n+=100;
str=itoa(n,buffer,10);
drawBitmapText(str,0.0f,2.0f,0.0f);
}
if(bricks[2][2]==true)
{
n+=100;
str=itoa(n,buffer,10);
drawBitmapText(str,0.0f,2.0f,0.0f);
}
if(bricks[2][1]==true)
{
n+=100;
str=itoa(n,buffer,10);
drawBitmapText(str,0.0f,2.0f,0.0f);
}
if(bricks[2][0]==true)
{
n+=100;
str=itoa(n,buffer,10);
drawBitmapText(str,0.0f,2.0f,0.0f);
}
basically I just redrew the screen as was suggested
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement