private boolean isWallAhead(final Commandable life) { final int RANGE = 5; final int x = life.getX(); final int y = life.getY(); if (life.getOrientation() == ORIENTATION.UP) { if (checkNewPosition(x, y - AbstractEnvironmentMap.STEP_SIZE * RANGE, life)) { return false; } } else if (life.getOrientation() == ORIENTATION.RIGHT) { if (checkNewPosition(x + AbstractEnvironmentMap.STEP_SIZE * RANGE, y, life)) { return false; } } else if (life.getOrientation() == ORIENTATION.DOWN) { if (checkNewPosition(x, y + AbstractEnvironmentMap.STEP_SIZE * RANGE, life)) { return false; } } else { if (checkNewPosition(x - AbstractEnvironmentMap.STEP_SIZE * RANGE, y, life)) { return false; } } return true; }