summaryrefslogtreecommitdiffstats
path: root/src/ball.c
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2021-03-30 04:14:06 (EDT)
committer P. J. McDermott <pj@pehjota.net>2021-03-30 04:14:06 (EDT)
commit486a72a549d928b3ac2ba806ca6ce8bb17b14a09 (patch)
tree68034ce76bbc1938185c84751f1c20f6ed941229 /src/ball.c
parent75cbbd416551fdcc789ffd215e1121c8d129e732 (diff)
downloaddodge-balls-486a72a549d928b3ac2ba806ca6ce8bb17b14a09.zip
dodge-balls-486a72a549d928b3ac2ba806ca6ce8bb17b14a09.tar.gz
dodge-balls-486a72a549d928b3ac2ba806ca6ce8bb17b14a09.tar.bz2
ball, map: Fix ball speed
Diffstat (limited to 'src/ball.c')
-rw-r--r--src/ball.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ball.c b/src/ball.c
index 2666a6e..4dc0ab0 100644
--- a/src/ball.c
+++ b/src/ball.c
@@ -84,8 +84,8 @@ void
db_balls_move(struct db_ball *ball)
{
if (ball->sr == 0) {
- ball->x += cos(ball->a * (M_PI / 180));
- ball->y += sin(ball->a * (M_PI / 180));
+ ball->x += cos(ball->a * (M_PI / 180)) * ball->s;
+ ball->y += sin(ball->a * (M_PI / 180)) * ball->s;
} else {
ball->a = fmod(ball->a + ball->d * ball->s, 360);
ball->x = ball->cx + cos(ball->a * (M_PI / 180)) * ball->sr;