|
@ -71,6 +71,13 @@ public class GamePanel extends JPanel implements Runnable { |
|
|
paddle_2.y2 = 0; |
|
|
paddle_2.y2 = 0; |
|
|
if (paddle_2.y2 >= (FRAME_HEIGHT-PADDLE_HEIGHT)) |
|
|
if (paddle_2.y2 >= (FRAME_HEIGHT-PADDLE_HEIGHT)) |
|
|
paddle_2.y2 = FRAME_HEIGHT-PADDLE_HEIGHT; |
|
|
paddle_2.y2 = FRAME_HEIGHT-PADDLE_HEIGHT; |
|
|
|
|
|
|
|
|
|
|
|
if(collisionChecker.didTouchLeftEdge(ball.x)) { |
|
|
|
|
|
score.player_2++; |
|
|
|
|
|
newPaddle(); |
|
|
|
|
|
newBall(); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|