void render(){ display.Clear(); drawGhost(); drawBlock(CODE); drawMap(); drawBorders(); drawNextBlock(); sprintf(TEXT,"Score: %i",score); display.DrawString(TEXT, ((WIDTH))*BLOCKPIXSIZE, (0)*BLOCKPIXSIZE,0,0x00FF00); sprintf(TEXT,"Highscore: %i",hscore); display.DrawString(TEXT, ((WIDTH))*BLOCKPIXSIZE, (1)*BLOCKPIXSIZE,0,0x00FF00); sprintf(TEXT,"Next:"); display.DrawString(TEXT, ((WIDTH))*BLOCKPIXSIZE, (4)*BLOCKPIXSIZE,0,0x00FF00); display.Render(); }
void checkGameState() { renderFrame(); renderNextBlockFrame(); switch (gameState) { case 0: // Game play printCanvasBlocks(); drawNextBlock(); renderBlock(); break; case 1: // Game pause drawPauseScreen(); break; case 2: // Game over drawGameOverScreen(); break; } drawInstructions(); drawScoreboard(); }