changeset 67:8134f0bdb6d0

nsnake: small minor fixes
author David Demelier <markand@malikania.fr>
date Thu, 30 Jan 2020 14:02:28 +0100
parents 9ef6bf3d8ad8
children cb5a02e0b2c8
files nsnake.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/nsnake.c	Thu Jan 30 13:52:28 2020 +0100
+++ b/nsnake.c	Thu Jan 30 14:02:28 2020 +0100
@@ -384,6 +384,7 @@
 static void
 draw(void)
 {
+	werase(game_view.top);
 	werase(game_view.frame);
 
 	for (int i = 0; i < snake.length; ++i) {
@@ -408,7 +409,7 @@
 	/* Print paused if necessary. */
 	if (snake.paused) {
 		mvwprintw(game_view.frame, HEIGHT / 2, (WIDTH / 2) - 3, "PAUSE");
-		mvwprintw(game_view.frame, (HEIGHT / 2) + 1, (WIDTH / 2) - 11, "Press any key to resume");
+		mvwprintw(game_view.frame, (HEIGHT / 2) + 1, (WIDTH / 2) - 12, "Press any key to resume");
 	}
 
 	/* Print score */
@@ -545,7 +546,7 @@
 
 	/* Print menu actions. */
 	const int cx = (COLS / 2) - 14;
-	const int cy = (LINES / 2) + (TITLE_HEIGHT / 2);
+	const int cy = (LINES / 2) + (TITLE_HEIGHT / 2) - 3;
 
 	mvprintw(cy + 2, cx, "Hit <Return> to play the game");
 	mvprintw(cy + 3, cx, "Hit <n> to %s scoring",
@@ -715,7 +716,7 @@
 	/* Init menu view. */
 	menu_view.top = newwin(1, 0, 0, 0);
 	menu_view.frame = newwin(TITLE_HEIGHT, TITLE_WIDTH,
-	    (LINES / 2) - (TITLE_HEIGHT / 2),
+	    (LINES / 2) - (TITLE_HEIGHT / 2) - 3,
 	    (COLS  / 2) - (TITLE_WIDTH / 2));
 
 	/* Init score view. */