tylerbingham
New member
I am having a problem with my Block() function. It changes the previous blocks to the current block type. I need a Tetris type draw function...where each time I call Block() I get a different block type, but the blocks already drawn stay the same instead of changing to the new block type. Here is the Block() function
void Block(int block_number) //Changed
{
glColor3f(1,1,1);
glPushMatrix();
glTranslatef(0,0,-8);
glTranslatef(block_x[block_number], block_y [block_number],0);
glRotatef(r,0,0,1);
glBegin(GL_QUADS);
glVertex2f(0,0);
glVertex2f(0,0.3f);
glVertex2f(0.5f,0.3f);
glVertex2f(0.5f,0);
glEnd();
glPopMatrix();
}
Thanx y'all
void Block(int block_number) //Changed
{
glColor3f(1,1,1);
glPushMatrix();
glTranslatef(0,0,-8);
glTranslatef(block_x[block_number], block_y [block_number],0);
glRotatef(r,0,0,1);
glBegin(GL_QUADS);
glVertex2f(0,0);
glVertex2f(0,0.3f);
glVertex2f(0.5f,0.3f);
glVertex2f(0.5f,0);
glEnd();
glPopMatrix();
}
Thanx y'all