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); score += snake_eat(s, f);
box(stdscr, 0, 0); box(stdscr, 0, 0);
mvprintw(getmaxy(stdscr) - 2, 1,
"score: %d | <%c> up | <%c> down | <%c> right | <%c> left | <%c> quit", mvprintw(getmaxy(stdscr) - 2, 1, "score: %d", score);
score, up_key, if (score < 4)
down_key, right_key, mvprintw(getmaxy(stdscr) - 2, 9,
left_key, quit_key); " | <%c> up | <%c> down | <%c> right | <%c> left | <%c> quit",
up_key, down_key, right_key, left_key, quit_key);
snake_print(s); snake_print(s);
field_print(f); field_print(f);