Here you can find the source of inRange(Integer x1, Integer y1, Integer x2, Integer y2)
public static Boolean inRange(Integer x1, Integer y1, Integer x2, Integer y2)
//package com.java2s; //License from project: Open Source License public class Main { public static Boolean inRange(Integer x1, Integer y1, Integer x2, Integer y2) { if (Math.abs(x1 - x2) > 60 || (Math.abs(y1 - y2)) > 60) { return false; } else {//from www . j ava 2s . co m return true; } } }