From: Armaan Bhojwani Date: Sun, 16 May 2021 00:42:13 +0000 (-0400) Subject: Add pause mode X-Git-Url: https://git.armaanb.net/?p=pong.git;a=commitdiff_plain;h=bc58931f55365885ae2ea0032d2d4334b5fd62ce Add pause mode --- diff --git a/pong.c b/pong.c index cea4d2a..58a93d5 100644 --- a/pong.c +++ b/pong.c @@ -85,6 +85,17 @@ main(void) { if (aoff < max_y - pad_h) aoff += 1; } else if (key == 'w') { if (aoff > 0) aoff -= 1; + } else if (key == 27) { + while(1) { + key = getch(); + mvprintw(0, 0, "PAUSED"); + if (key == 27) { + clear(); + break; + } else if (key == 'q') { + die(0); + } + } } // Clear screen