summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmaan Bhojwani <me@armaanb.net>2021-05-15 20:42:13 -0400
committerArmaan Bhojwani <me@armaanb.net>2021-05-15 20:42:13 -0400
commitbc58931f55365885ae2ea0032d2d4334b5fd62ce (patch)
tree105d05ea9377a2b227f55174b3ddf7e1edb20ae4
parentdb8443ee2307b9c87fe8983b3ce4299ea2b60d79 (diff)
downloadpong-bc58931f55365885ae2ea0032d2d4334b5fd62ce.tar.gz
Add pause mode
-rw-r--r--pong.c11
1 files changed, 11 insertions, 0 deletions
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