Browse Source

update

main
fdai4616 2 years ago
parent
commit
9b4ab2a533
  1. 7
      src/main/java/PingPong/GamePanel.java

7
src/main/java/PingPong/GamePanel.java

@ -71,6 +71,13 @@ public class GamePanel extends JPanel implements Runnable {
paddle_2.y2 = 0; paddle_2.y2 = 0;
if (paddle_2.y2 >= (FRAME_HEIGHT-PADDLE_HEIGHT)) if (paddle_2.y2 >= (FRAME_HEIGHT-PADDLE_HEIGHT))
paddle_2.y2 = FRAME_HEIGHT-PADDLE_HEIGHT; paddle_2.y2 = FRAME_HEIGHT-PADDLE_HEIGHT;
if(collisionChecker.didTouchLeftEdge(ball.x)) {
score.player_2++;
newPaddle();
newBall();
}
} }

Loading…
Cancel
Save