Browse Source

refactoring:

main
fdai4616 2 years ago
parent
commit
f0109dfba0
  1. 10
      src/main/java/PingPong/Paddle.java

10
src/main/java/PingPong/Paddle.java

@ -32,10 +32,18 @@ public class Paddle extends Rectangle {
public void move() {
y1 += yVelocity1;
yVol1();
yVol2();
}
private void yVol2() {
y2 += yVelocity2;
}
private void yVol1() {
y1 += yVelocity1;
}
public void setYDirection(int yDirection, int paddleId) {
if (paddleId == 1) {

Loading…
Cancel
Save