forked from nakidai/csnake
Fix bug when game freezes on max possible score
parent
bcf6465f4e
commit
c31de323f0
|
@ -68,7 +68,7 @@ int main(int argc, char **argv)
|
||||||
player->direction = LEFT; break;
|
player->direction = LEFT; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (playerDoTick(player, food))
|
if (playerDoTick(player, food) && player->score >= SIZE*SIZE - 1)
|
||||||
food = generateFood(player);
|
food = generateFood(player);
|
||||||
head_x = player->head->x;
|
head_x = player->head->x;
|
||||||
head_y = player->head->y;
|
head_y = player->head->y;
|
||||||
|
|
Loading…
Reference in New Issue