|
@ -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; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |