X-Git-Url: https://git.armaanb.net/?p=pong.git;a=blobdiff_plain;f=pong.c;h=e03aa17f75123ef4409f1fabe2ea3e8f375e378b;hp=c15860731b9cabf998e285cb39223741450781d2;hb=a0b0440d532e994bf1c1cb848b027d8a9e4963cc;hpb=c8a444f1416c62879ad1d3ffb97019c25d24d79d 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;