Guest User

Untitled

a guest
Jan 22nd, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. public int[] jumpPos(int column, int row, int enemyCol, int enemyRow)
  2. {
  3. if(column > enemyCol && row > enemyRow && gameData[column-2][row-2] == 0)
  4. return new int[] {column-2, row-2};
  5. else if(column > enemyCol && row < enemyRow && gameData[column-2][row+2] == 0)
  6. return new int[] {column-2, row+2};
  7. else if(column < enemyCol && row > enemyRow && gameData[column+2][row-2] == 0)
  8. return new int[] {column+2, row-2};
  9. else
  10. return new int[] {column+2, row+2};
  11. }
Add Comment
Please, Sign In to add comment