Browse Source

refactoring:

main
fdai4616 2 years ago
parent
commit
ccf2517fbf
  1. 6
      src/main/java/PingPong/Paddle.java

6
src/main/java/PingPong/Paddle.java

@ -56,7 +56,7 @@ public class Paddle extends Rectangle {
public void draw(Graphics g) {
if (id == 1) {
g.setColor(Color.BLUE);
Paddle2(g);
g.fillRect(x, y1, width, height);
} else {
Paddle1(g);
@ -64,6 +64,10 @@ public class Paddle extends Rectangle {
}
}
private static void Paddle2(Graphics g) {
g.setColor(Color.BLUE);
}
private static void Paddle1(Graphics g) {
g.setColor(Color.YELLOW);
}

Loading…
Cancel
Save