Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. public void moveAsh(int posX, int posY, String str) {
  2.  
  3. if (ESTE.equals(str)) {
  4. this.grid[posX][posY] = caught;
  5. this.grid[posX][posY + 1] = ash;
  6. int newPosY = posY + 1;
  7. pokemon++;
  8. }
  9. if (OESTE.equals(str)) {
  10. this.grid[posX][posY] = caught;
  11. this.grid[posX][posY - 1] = ash;
  12. int newPosY = posY - 1;
  13. pokemon++;
  14. }
  15. if (SUL.equals(str)) {
  16. this.grid[posX][posY] = caught;
  17. this.grid[posX + 1][posY] = ash;
  18. int newPosX = posX + 1;
  19. pokemon++;
  20. }
  21. if (NORTE.equals(str)) {
  22. this.grid[posX][posY] = caught;
  23. this.grid[posX - 1][posY] = ash;
  24. int newPosX = posX - 1;
  25. pokemon++;
  26. }
  27. System.out.println("POS X: " + posX);
  28. System.out.println("POS Y: " + posX);
  29. System.out.println("NEW POS X: " + newPosX);
  30. System.out.println("NEW POS Y: " + newPosX);
  31. setX(newPosX);
  32. setY(newPosY);
  33. }
  34.  
  35. public void setX(int newPosX) {
  36. this.posX = newPosX;
  37. }
  38.  
  39. public void setY(int newPosY) {
  40. this.posY = newPosY;
  41. }
  42.  
  43. public int getX() {
  44. return posX;
  45. }
  46.  
  47. public int getY() {
  48. return posY;
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement