From 1c5f2fa86286137a86da01cbc3f67e204442b558 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Tue, 30 Mar 2021 01:02:57 -0400 Subject: ball: Undo bounce reduction --- diff --git a/src/ball.c b/src/ball.c index 552aadd..5c0497d 100644 --- a/src/ball.c +++ b/src/ball.c @@ -118,7 +118,6 @@ db_balls_collisions(struct db_ball *ball) int x_max; int y_min; int y_max; - SDL_bool bounce; int x; int y; double col_x; @@ -131,7 +130,6 @@ db_balls_collisions(struct db_ball *ball) x_max = ceil ((ball->x + ball->r) / map_tw); y_min = floor((ball->y - ball->r) / map_th); y_max = ceil ((ball->y + ball->r) / map_th); - bounce = SDL_FALSE; for (y = y_min; y < y_max; ++y) { for (x = x_min; x < x_max; ++x) { if (db_map_tile_ball_collides(ball->map, x, y)) { @@ -139,14 +137,11 @@ db_balls_collisions(struct db_ball *ball) wall.y = y * map_th; if (db_col_cir_rect(ball->x, ball->y, ball->r, &wall, &col_x, &col_y)){ - bounce = SDL_TRUE; + _db_ball_bounce(ball, col_x, col_y); } } } } - if (bounce) { - _db_ball_bounce(ball, col_x, col_y); - } /* Spinning balls shouldn't collide with any other balls */ if (ball->sr == 0) { -- cgit v0.9.1