Advertisement
Guest User

ryan is stupid

a guest
Nov 19th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. public void moveForward(){
  2. slow();
  3. if((_Y + 100) < 800){
  4. _Y = _Y + 100;
  5. updateFrame();
  6. if(_cones.collideWithCone(this)){
  7. _Y = _Y - 100;
  8. updateFrame();
  9. }
  10. }
  11. }
  12.  
  13. public void moveBackward(){
  14. slow();
  15. if((_Y - 100) > 0){
  16. _Y = _Y - 100;
  17. updateFrame();
  18. if(_cones.collideWithCone(this)){
  19. _Y = _Y + 100;
  20. updateFrame();
  21. }
  22. }
  23. }
  24.  
  25. public void moveRight(){
  26. slow();
  27. if((_X + 100) < 800){
  28. _X = _X + 100;
  29. updateFrame();
  30. if(_cones.collideWithCone(this)){
  31. _X = _X - 100;
  32. updateFrame();
  33. }
  34. }
  35. }
  36.  
  37. public void moveLeft(){
  38. slow();
  39. if((_X - 100) > 0){
  40. _X = _X - 100;
  41. updateFrame();
  42. if(_cones.collideWithCone(this)){
  43. _X = _X + 100;
  44. updateFrame();
  45. }
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement