D1249360 費柏叡
DEMO
現在分數,最高分數
typedef struct
{
int x;
int y;
int score;
int bestScore;//new
int rotate;
int fallTime;
ShapeId queue[4];
} State;
void logic(Block canvas[CANVAS_HEIGHT][CANVAS_WIDTH], State* state)
{
...
// 紀錄分數
state->score += clearLine(canvas);
// 紀錄最高分
if (state->score > state->bestScore) {
state->bestScore = state->score;
}
}

//printCanvas
if (state->isPause) {
printf("\\033[%d;%dH\\x1b[41m PAUSEING\\x1b[0m\\033[%d;%dH", CANVAS_HEIGHT - 8, CANVAS_WIDTH * 2 - 12 , CANVAS_HEIGHT + 5, 0);
}
//logic
if (GetAsyncKeyState(PAUSE_KEY) & 0x8000) {
state->isPause = !state->isPause;
}
if (!state->isPause){
...
}
else if (state->isPause) {
printCanvas(canvas, state);
}