Browse Source

update

main
fdai4616 2 years ago
parent
commit
d1886f08a1
  1. 19
      src/main/java/PingPong/Paddle.java

19
src/main/java/PingPong/Paddle.java

@ -3,10 +3,23 @@ package PingPong;
import java.awt.*; import java.awt.*;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
public class Paddle {
public void draw(Graphics g) {
}
public class Paddle extends Rectangle{
int y1;
int y2;
int id;
Paddle(int x, int y, int width, int height, int id) {
//super(x, y, width, height);
this.x = x;
if (id == 1) {
y1 = y;
} else if (id == 2) {
y2 = y;
}
this.width = width;
this.height = height;
this.id = id;
}
public void pressed(KeyEvent e) { public void pressed(KeyEvent e) {
} }

Loading…
Cancel
Save