From d89a20134b577e9176ceab4cb2ca22d189cd7cf4 Mon Sep 17 00:00:00 2001 From: Matt Low Date: Mon, 12 Nov 2018 11:50:50 +0400 Subject: [PATCH] Only check for paddle collision when ball position <= paddle height. --- core/src/com/me/brickbuster/entity/Ball.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/com/me/brickbuster/entity/Ball.java b/core/src/com/me/brickbuster/entity/Ball.java index 0b89a89..be2fe4f 100644 --- a/core/src/com/me/brickbuster/entity/Ball.java +++ b/core/src/com/me/brickbuster/entity/Ball.java @@ -75,7 +75,7 @@ public class Ball extends Entity { return; } - if (direction.y < 0) { + if (direction.y < 0 && new_pos.y <= Paddle.PADDLE_Y + Paddle.PADDLE_HEIGHT + RADIUS) { Pair paddle = getBrickBuster().getPaddle().getTopEdge(); Vector2 lineDir = paddle.getValue().sub(paddle.getKey()); Vector2 nearest = Utils.nearestPoint(paddle.getKey().cpy(), lineDir, new_pos.cpy());