Game Development Reference
In-Depth Information
7.
Cells of the game ield are rendered on top of the background followed by the current
shape above them:
for ( int i = 0; i < g_Field.FWidth; i++ )
{
for ( int j = FIELD_INVISIBLE_RAWS;j < g_Field.FHeight;
j++ )
{
int c = g_Field.FField[i][j];
if ( c >= 0 && c < NUM_COLORS )
{
int Img = c % NUM_BRICK_IMAGES;
int P = ( j - FIELD_INVISIBLE_RAWS );
8. Every cell of the ield is just a tiny rectangle with a texture:
DrawTexQuad( i * 20.0f + 2.0f,
P * 20.0f + 2.0f,16.0f, 16.0f,
Field_X1, Field_Y1,
g_Colors[c], Img );
}
}
}
9.
The current shape is rendered in one line:
DrawFigure(&g_CurrentFigure, g_GS.FCurX,
g_GS.FCurY - FIELD_INVISIBLE_RAWS,Field_X1, Field_Y1,
BLOCK_SIZE );
 
Search WWH ::




Custom Search