summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmaan Bhojwani <me@armaanb.net>2021-05-16 09:25:14 -0400
committerArmaan Bhojwani <me@armaanb.net>2021-05-16 09:25:14 -0400
commita0b0440d532e994bf1c1cb848b027d8a9e4963cc (patch)
tree0f0d1ba0c72066e00e4e9c61bc20f5c986a69b30
parentc8a444f1416c62879ad1d3ffb97019c25d24d79d (diff)
downloadpong-a0b0440d532e994bf1c1cb848b027d8a9e4963cc.tar.gz
Clean upHEADmain
-rw-r--r--pong.c4
1 files 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;