Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void collissionWall() {
- if (ball.collidesWith(wallsMid)) {
- ball.setSpeedX(-ball.getSpeedX());
- }
- if (ball.collidesWith(wallsTop)) {
- ball.setSpeedY(-ball.getSpeedY());
- }
- if (ball.collidesWith(wallsBot)) {
- ball.setSpeedY(-ball.getSpeedY());
- if (bat.collidesWith(wallsTop))
- bat.setLocation(1300, 71);
- if (bat.collidesWith(wallsBot))
- bat.setLocation(1300, 439);
- if(ball.atHorizontalEdge()){
- }
- if (ball.atHorizontalEdge()) {
- removeActorFromWorld(ball);
- }
- if (bat.collidesWith(wallsTop)) {
- //bat.setSpeedY(-0);
- bat.setLocation(1300, 71);
- }
- if (bat.collidesWith(wallsBot)) {
- //bat.setSpeedY(-0);
- bat.setLocation(1300, 439);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement