Browse Source

refactoring:

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

14
src/main/java/PingPong/Paddle.java

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

Loading…
Cancel
Save