From 9b4ab2a533f58628c0a1f9d5d785da09eb9ffdbe Mon Sep 17 00:00:00 2001 From: fdai4616 Date: Wed, 8 Feb 2023 20:48:21 +0100 Subject: [PATCH] update --- src/main/java/PingPong/GamePanel.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/PingPong/GamePanel.java b/src/main/java/PingPong/GamePanel.java index 384db1b..e84d959 100644 --- a/src/main/java/PingPong/GamePanel.java +++ b/src/main/java/PingPong/GamePanel.java @@ -71,6 +71,13 @@ public class GamePanel extends JPanel implements Runnable { paddle_2.y2 = 0; if (paddle_2.y2 >= (FRAME_HEIGHT-PADDLE_HEIGHT)) paddle_2.y2 = FRAME_HEIGHT-PADDLE_HEIGHT; + + if(collisionChecker.didTouchLeftEdge(ball.x)) { + score.player_2++; + newPaddle(); + newBall(); + + } }