made controls info disappear after score >= 4

This commit is contained in:
Noah Swerhun 2021-10-03 20:34:14 -05:00
parent 6b7ca2683e
commit dbdb2ee926

View file

@ -99,11 +99,13 @@ int main(void) {
score += snake_eat(s, f);
box(stdscr, 0, 0);
mvprintw(getmaxy(stdscr) - 2, 1,
"score: %d | <%c> up | <%c> down | <%c> right | <%c> left | <%c> quit",
score, up_key,
down_key, right_key,
left_key, quit_key);
mvprintw(getmaxy(stdscr) - 2, 1, "score: %d", score);
if (score < 4)
mvprintw(getmaxy(stdscr) - 2, 9,
" | <%c> up | <%c> down | <%c> right | <%c> left | <%c> quit",
up_key, down_key, right_key, left_key, quit_key);
snake_print(s);
field_print(f);