breakout game scoring

Started by
11 comments, last by phil67rpg 11 years, 1 month ago

well I have solved my problem thanks for all the help

Advertisement

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 :)

Beginner in Game Development?  Read here. And read here.

 

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