|
@ -25,17 +25,28 @@ public class GamePanel extends JPanel implements Runnable { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void run() { |
|
|
public void run() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void draw(Graphics g) { |
|
|
public void draw(Graphics g) { |
|
|
score.draw(g); |
|
|
score.draw(g); |
|
|
paddle_1.draw(g); |
|
|
paddle_1.draw(g); |
|
|
paddle_2.draw(g); |
|
|
paddle_2.draw(g); |
|
|
ball.draw(g); |
|
|
ball.draw(g); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
public void move() { |
|
|
|
|
|
|
|
|
|
|
|
paddle_1.move(); |
|
|
|
|
|
paddle_2.move(); |
|
|
|
|
|
ball.move(); |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
public void paint(Graphics g) { |
|
|
public void paint(Graphics g) { |
|
|
image = createImage(getWidth(), getHeight()); |
|
|
image = createImage(getWidth(), getHeight()); |
|
|