summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2021-03-26 23:25:54 (EDT)
committer P. J. McDermott <pj@pehjota.net>2021-03-26 23:25:54 (EDT)
commit90e42581e1360da1d422d40545fc5fd24f531813 (patch)
tree7472d44ae97a1f6a3b63b935eedc1b894d7199f2
parent2bac5f3298af1c09576cfaaa2b3bcce019d04e91 (diff)
downloaddodge-balls-90e42581e1360da1d422d40545fc5fd24f531813.zip
dodge-balls-90e42581e1360da1d422d40545fc5fd24f531813.tar.gz
dodge-balls-90e42581e1360da1d422d40545fc5fd24f531813.tar.bz2
ball: Move straight balls
-rw-r--r--src/ball.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ball.c b/src/ball.c
index 2a2c721..3230628 100644
--- a/src/ball.c
+++ b/src/ball.c
@@ -80,6 +80,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));
} else {
ball->a += ball->d * ball->s;
ball->x = ball->cx + cos(ball->a * (M_PI / 180)) * ball->sr;