summaryrefslogtreecommitdiffstats
path: root/src/ball.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ball.c')
-rw-r--r--src/ball.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/ball.c b/src/ball.c
index ccdccec..d7941b9 100644
--- a/src/ball.c
+++ b/src/ball.c
@@ -102,11 +102,15 @@ db_balls_collisions(struct db_ball *ball)
int col_x;
int col_y;
- for (other = ball->next; other != NULL; other = other->next) {
- if (db_col_pt_cir_cir(ball->x, ball->y, ball->r,
- other->x, other->y, other->r,
- &col_x, &col_y)) {
- /* TODO: Reverse direction */
+ /* Spinning balls shouldn't collide with any other balls */
+ if (ball->sr == 0) {
+ for (other = ball->next; other != NULL; other = other->next) {
+ if (other->sr == 0 && db_col_pt_cir_cir(
+ ball->x, ball->y, ball->r,
+ other->x, other->y, other->r,
+ &col_x, &col_y)) {
+ /* TODO: Reverse direction */
+ }
}
}