From 1aeab73cd08666b607ea766b31dc7ecaf2354811 Mon Sep 17 00:00:00 2001 From: Matt Low Date: Tue, 20 Nov 2018 12:15:55 +0400 Subject: [PATCH] Delete bricks that go below the bottom of the play field --- core/src/com/me/brickbuster/entity/Brick.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/src/com/me/brickbuster/entity/Brick.java b/core/src/com/me/brickbuster/entity/Brick.java index 6321ca1..ac32922 100644 --- a/core/src/com/me/brickbuster/entity/Brick.java +++ b/core/src/com/me/brickbuster/entity/Brick.java @@ -78,6 +78,10 @@ public class Brick extends Entity implements PhysicsBody, CollisionListener { hit(); hitByBall = false; } + + if (getY() - BRICK_HEIGHT < 0) { + delete(); + } } @Override