From a0b0440d532e994bf1c1cb848b027d8a9e4963cc Mon Sep 17 00:00:00 2001 From: Armaan Bhojwani Date: Sun, 16 May 2021 09:25:14 -0400 Subject: [PATCH] Clean up --- pong.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pong.c b/pong.c index c158607..e03aa17 100644 --- a/pong.c +++ b/pong.c @@ -41,7 +41,7 @@ msleep(void) { struct timeval timeout; timeout.tv_usec = 10000; - select(NULL, NULL, NULL, NULL, &timeout); // Sleep 100 ms + select(0, NULL, NULL, NULL, &timeout); // Sleep 100 ms } int @@ -152,7 +152,7 @@ main(void) { /* Find the distance that the ball hits from the center of the padel and accordingly adjust ball path */ int poff = (x <= 1) ? aoff : boff; - double fromc = (fabs(poff + 0.5 * pad_h - y) / 2); + double fromc = fabs(poff + 0.5 * pad_h - y) / 3; slope_x /= (abs(slope_x) > 25) ? 2 : fromc; slope_x = (slope_x < 2) ? 2 : slope_x; -- 2.39.2