Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int[] jumpPos(int column, int row, int enemyCol, int enemyRow)
- {
- if(column > enemyCol && row > enemyRow && gameData[column-2][row-2] == 0)
- return new int[] {column-2, row-2};
- else if(column > enemyCol && row < enemyRow && gameData[column-2][row+2] == 0)
- return new int[] {column-2, row+2};
- else if(column < enemyCol && row > enemyRow && gameData[column+2][row-2] == 0)
- return new int[] {column+2, row-2};
- else
- return new int[] {column+2, row+2};
- }
Add Comment
Please, Sign In to add comment