Added speed boost after a certain amount of bricks remain
Reset board after all bricks are destroyed
This commit is contained in:
parent
78d0a72217
commit
711a5548ef
@ -60,6 +60,10 @@ public class BrickBuster extends ApplicationAdapter {
|
||||
}
|
||||
ball.update(dt);
|
||||
paddle.update(dt);
|
||||
if (getBricks().isEmpty()) {
|
||||
create();
|
||||
playing = false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -51,6 +51,9 @@ public class Ball extends Entity {
|
||||
|
||||
if (nearest.dst(new_pos.x, new_pos.y) <= RADIUS) {
|
||||
brickIterator.remove();
|
||||
if (getBrickBuster().getBricks().size() <= 39) {
|
||||
speed = 8;
|
||||
}
|
||||
Utils.reflect(direction, segment.nor());
|
||||
brick_collision = true;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user