/** Computes and returns the distance between two entities */ public int getDistance(WorldEntity e) { Point wp = e.getPosition(); Point mep = getPosition(); int dx = wp.x - mep.x; int dy = wp.y - mep.y; return ((int) Math.round(Math.sqrt(dx * dx + dy * dy))); }