Browse Source

update

main
fdai4616 2 years ago
parent
commit
381f72d200
  1. 4
      src/main/java/PingPong/GamePanel.java

4
src/main/java/PingPong/GamePanel.java

@ -39,6 +39,10 @@ public class GamePanel extends JPanel implements Runnable {
}
public void checkCollision() {
//Reflection of Ball when it touches top and bottom edges!
if(collisionChecker.didTouchTopOrBottomEdge(ball.y, FRAME_HEIGHT-BALL_DIAMETER)) {
ball.setYDirection(-ball.yVelocity);
}
}

Loading…
Cancel
Save