Browse Source

update

main
fdai4616 2 years ago
parent
commit
4acc547bae
  1. 5
      src/main/java/PingPong/Paddle.java

5
src/main/java/PingPong/Paddle.java

@ -31,8 +31,12 @@ public class Paddle extends Rectangle {
} }
public void move() { public void move() {
y1 += yVelocity1;
y2 += yVelocity2;
} }
public void setYDirection(int yDirection, int paddleId) { public void setYDirection(int yDirection, int paddleId) {
if (paddleId == 1) { if (paddleId == 1) {
yVelocity1 = yDirection; yVelocity1 = yDirection;
@ -40,4 +44,5 @@ public class Paddle extends Rectangle {
yVelocity2 = yDirection; yVelocity2 = yDirection;
} }
} }
} }
Loading…
Cancel
Save