Use brick.hit() as a check for whether the brick should be removed.
This commit is contained in:
parent
e1c7fbb53f
commit
4a7c9215dd
@ -61,8 +61,9 @@ public class Ball extends Entity {
|
||||
Vector2 nearest = Utils.nearestPoint(v1.cpy(), segment, new_pos.cpy());
|
||||
|
||||
if (nearest.dst(new_pos.x, new_pos.y) <= RADIUS) {
|
||||
if (brick.hit()) {
|
||||
brickIterator.remove();
|
||||
brick.hit();
|
||||
}
|
||||
Utils.reflect(direction, segment.nor());
|
||||
brickCollision = true;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user