Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (paddle.collision(ball1)){
- if (ball1.getCenterY() + ball1.getRadius()<paddle.getTopLeftY()||ball1.getCenterY() - ball1.getRadius()>paddle.getTopLeftY()){
- ball1.setDirectionX(ball1.getDirectionX()*-1);
- }
- else{ball1.setDirectionY(ball1.getDirectionY()*-1);}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement