Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. public boolean withinDistance(WorldTile tile, int distance) {
  2. if (tile.plane != plane)
  3. return false;
  4. int deltaX = tile.x - x, deltaY = tile.y - y;
  5. return deltaX <= distance && deltaX >= -distance && deltaY <= distance && deltaY >= -distance;
  6. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement