From aaf0897e8365380292a2e3e3cad91dd2cf1beddf Mon Sep 17 00:00:00 2001 From: fdai4616 Date: Wed, 8 Feb 2023 20:49:08 +0100 Subject: [PATCH] update --- src/main/java/PingPong/GamePanel.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/PingPong/GamePanel.java b/src/main/java/PingPong/GamePanel.java index e84d959..40e0f1f 100644 --- a/src/main/java/PingPong/GamePanel.java +++ b/src/main/java/PingPong/GamePanel.java @@ -78,6 +78,11 @@ public class GamePanel extends JPanel implements Runnable { newBall(); } + if(collisionChecker.didTouchRightEdge(ball.x, FRAME_WIDTH-BALL_DIAMETER)) { + score.player_1++; + newPaddle(); + newBall(); + } }