Coord q = point.translateCapped(Math.round(newX), Math.round(newY), width, height); int frustration = 0; while(restricted && blocked.contains(map[q.x][q.y]) && frustration < 8) newX = radius * NumberTools.sin(angle); newY = radius * NumberTools.cos(angle); q = point.translateCapped(Math.round(newX), Math.round(newY), width, height); frustration++;
Coord q = point.translateCapped(Math.round(newX), Math.round(newY), maxX, maxY);