Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //before
- if (ballPos.x > playerPos.x+playerPaddle.getWidth()/2 && ballPos.x < playerPos.x+playerPaddle.getWidth()
- && ballPos.y < playerPos.y+playerPaddle.getHeight() && ballPos.y > playerPos.y-(playerPaddle.getHeight()/2)){
- ballDirection.x *= -1;
- }
- //after
- if (playerBox.contains(ballBox)){
- ballDirection.x *= -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement