Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void moveAsh(int posX, int posY, String str) {
- if (ESTE.equals(str)) {
- this.grid[posX][posY] = caught;
- this.grid[posX][posY + 1] = ash;
- int newPosY = posY + 1;
- pokemon++;
- }
- if (OESTE.equals(str)) {
- this.grid[posX][posY] = caught;
- this.grid[posX][posY - 1] = ash;
- int newPosY = posY - 1;
- pokemon++;
- }
- if (SUL.equals(str)) {
- this.grid[posX][posY] = caught;
- this.grid[posX + 1][posY] = ash;
- int newPosX = posX + 1;
- pokemon++;
- }
- if (NORTE.equals(str)) {
- this.grid[posX][posY] = caught;
- this.grid[posX - 1][posY] = ash;
- int newPosX = posX - 1;
- pokemon++;
- }
- System.out.println("POS X: " + posX);
- System.out.println("POS Y: " + posX);
- System.out.println("NEW POS X: " + newPosX);
- System.out.println("NEW POS Y: " + newPosX);
- setX(newPosX);
- setY(newPosY);
- }
- public void setX(int newPosX) {
- this.posX = newPosX;
- }
- public void setY(int newPosY) {
- this.posY = newPosY;
- }
- public int getX() {
- return posX;
- }
- public int getY() {
- return posY;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement