Advertisement
Guest User

möö

a guest
Nov 25th, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. public void collissionWall() {
  2.  
  3. if (ball.collidesWith(wallsMid)) {
  4. ball.setSpeedX(-ball.getSpeedX());
  5. }
  6.  
  7. if (ball.collidesWith(wallsTop)) {
  8. ball.setSpeedY(-ball.getSpeedY());
  9. }
  10.  
  11. if (ball.collidesWith(wallsBot)) {
  12. ball.setSpeedY(-ball.getSpeedY());
  13.  
  14.  
  15. if (bat.collidesWith(wallsTop))
  16. bat.setLocation(1300, 71);
  17.  
  18. if (bat.collidesWith(wallsBot))
  19. bat.setLocation(1300, 439);
  20.  
  21.  
  22. if(ball.atHorizontalEdge()){
  23.  
  24. }
  25.  
  26. if (ball.atHorizontalEdge()) {
  27.  
  28. removeActorFromWorld(ball);
  29. }
  30. if (bat.collidesWith(wallsTop)) {
  31. //bat.setSpeedY(-0);
  32. bat.setLocation(1300, 71);
  33. }
  34.  
  35. if (bat.collidesWith(wallsBot)) {
  36. //bat.setSpeedY(-0);
  37. bat.setLocation(1300, 439);
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement