summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ball.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ball.c b/src/ball.c
index 767b565..14ee8de 100644
--- a/src/ball.c
+++ b/src/ball.c
@@ -87,7 +87,7 @@ db_balls_move(struct db_ball *ball)
ball->x += cos(ball->a * (M_PI / 180));
ball->y += sin(ball->a * (M_PI / 180));
} else {
- ball->a += ball->d * ball->s;
+ ball->a = fmod(ball->a + ball->d * ball->s, 360);
ball->x = ball->cx + cos(ball->a * (M_PI / 180)) * ball->sr;
ball->y = ball->cy + sin(ball->a * (M_PI / 180)) * ball->sr;
db_dbg("Spinning ball angle %f (speed %f, direction %d)",