public boolean attemptDirection(String dir, double x, double y) {
        Rectangle nextLoc = new Rectangle(boundingBox);
        boolean isDirectionFree = false;
        if(dir.equals("up")) {
            nextLoc.setLocation( (int)(x+0*speed), (int)(y-1*speed) );
            if(room.isLocationFree(nextLoc,isEaten)) {
                isDirectionFree = true;
            } else {
                isDirectionFree = false;
            }
        } else if(dir.equals("down")) {
            nextLoc.setLocation( (int)(x+0*speed), (int)(y+1*speed) );
            if(room.isLocationFree(nextLoc,isEaten)) {
                isDirectionFree = true;
            } else {
                isDirectionFree = false;
            }
        } else if(dir.equals("left")) {
            nextLoc.setLocation( (int)(x-1*speed), (int)(y+0*speed) );
            if(room.isLocationFree(nextLoc,isEaten)) {
                isDirectionFree = true;
            } else {
                isDirectionFree = false;
            }
        } else if(dir.equals("right")) {
            nextLoc.setLocation( (int)(x+1*speed), (int)(y+0*speed) );
            if(room.isLocationFree(nextLoc,isEaten)) {
                isDirectionFree = true;
            } else {
                isDirectionFree = false;
            }
        }
        return isDirectionFree;
    }