|
|
@ -28,6 +28,7 @@ public class GamePanel extends JPanel implements Runnable { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void run() { |
|
|
|
|
|
|
|
|
|
|
@ -59,7 +60,10 @@ public class GamePanel extends JPanel implements Runnable { |
|
|
|
|
|
|
|
ball = new Ball((FRAME_WIDTH/2)-(BALL_DIAMETER/2), ((FRAME_HEIGHT/2)-(BALL_DIAMETER/2)), BALL_DIAMETER, BALL_DIAMETER); |
|
|
|
} |
|
|
|
|
|
|
|
public void newPeddle() { |
|
|
|
paddle_1 = new Paddle(0, (FRAME_HEIGHT/2)-(PADDLE_HEIGHT/2), PADDLE_WIDTH, PADDLE_HEIGHT, 1 ); |
|
|
|
paddle_2 = new Paddle(FRAME_WIDTH-PADDLE_WIDTH, (FRAME_HEIGHT/2)-(PADDLE_HEIGHT/2), PADDLE_WIDTH, PADDLE_HEIGHT, 2 ); |
|
|
|
} |
|
|
|
public class AL extends KeyAdapter { |
|
|
|
|
|
|
|
public void keyPressed(KeyEvent e) { |
|
|
|