Browse Source

update

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

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

@ -23,6 +23,7 @@ public class Paddle extends Rectangle {
this.id = id;
}
public void pressed(KeyEvent e) {
}
@ -53,4 +54,13 @@ public class Paddle extends Rectangle {
}
}
public void draw(Graphics g) {
if (id == 1) {
g.setColor(Color.BLUE);
g.fillRect(x, y1, width, height);
} else {
g.setColor(Color.YELLOW);
g.fillRect(x, y2, width, height);
}
}
}
Loading…
Cancel
Save