]> git.armaanb.net Git - pong.git/commitdiff
Draw scores in center
authorArmaan Bhojwani <me@armaanb.net>
Sat, 15 May 2021 21:49:15 +0000 (17:49 -0400)
committerArmaan Bhojwani <me@armaanb.net>
Sat, 15 May 2021 21:49:15 +0000 (17:49 -0400)
pong.c

diff --git a/pong.c b/pong.c
index 5b7b0395a96fa7e9f8a28577b0c52f45ef44a0f3..83d3647ec2b3a2977cd24e541b6f1dda73b212e4 100644 (file)
--- a/pong.c
+++ b/pong.c
@@ -86,8 +86,9 @@ main(void) {
                        mvprintw(i, max_x/2, ":");
                }
 
-               mvprintw(0, 2, "%d", a_score);
-               mvprintw(0, max_x - 1, "%d", b_score);
+               // Draw scrores
+               mvprintw(0, max_x/2 - 2, "%d", a_score);
+               mvprintw(0, max_x/2 + 2, "%d", b_score);
 
                // Move ball if enough time has elapsed
                gettimeofday(&stop, NULL);