summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmaan Bhojwani <me@armaanb.net>2021-05-15 21:41:44 -0400
committerArmaan Bhojwani <me@armaanb.net>2021-05-15 21:41:44 -0400
commit1cfbdcdeeb9260b901cb8e78ed656354d7415550 (patch)
tree59321861b68ceeb8e01c8a6bb7a186acd771c58f
parentbf728d1eb98174938d4f5e895eb563431c9c9cd4 (diff)
downloadpong-1cfbdcdeeb9260b901cb8e78ed656354d7415550.tar.gz
Reset y value of ball after point
-rw-r--r--pong.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pong.c b/pong.c
index 72b5602..a61bc0d 100644
--- a/pong.c
+++ b/pong.c
@@ -159,12 +159,16 @@ main(void) {
mvprintw(0, 0, "PLAYER A SCORES");
}
refresh();
+
+ // Reset to default values
x = max_x/2;
+ y = max_y / 2;
slope_x = randslope();
index_dir = randsign();
speed = randspeed();
aoff = max_y / 2 - pad_h;
boff = max_y / 2 - pad_h;
+
sleep(1);
clear();
} else if (y == 0 || y == max_y) {