diff options
-rw-r--r-- | src/ball.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -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 */ + } } } |