private void addDoor(int x, int y){
        Transform doorTransform = new Transform();

        boolean xDoor = (level.getPixel(x, y - 1) & 0xFFFFFF) == 0
                        &&(level.getPixel(x, y + 1) & 0xFFFFFF) == 0;

        boolean yDoor = (level.getPixel(x - 1, y) & 0xFFFFFF) == 0
                &&(level.getPixel(x + 1, y) & 0xFFFFFF) == 0;

        if(!(xDoor ^ yDoor)){
            System.err.println("Level generation has failed! Door placed in invalid location" + x + "," + y);
            new Exception().printStackTrace();
            System.exit(1);
        }

        Vector3f openPosition = null;

        if(yDoor){
            doorTransform.setTranslation(x, 0, y + SPOT_LENGTH / 2);
            openPosition = doorTransform.getTranslation().sub(new Vector3f(DOOR_OPEN_MOVEMENT_AMOUNT, 0.0f, 0.0f));
        }

        if(xDoor){
            doorTransform.setTranslation(x + SPOT_WIDTH / 2, 0, y);
            doorTransform.setRotation(0, 90, 0);
            openPosition = doorTransform.getTranslation().sub(new Vector3f(0.0f, 0.0f, DOOR_OPEN_MOVEMENT_AMOUNT));
        }

        doors.add(new Door(doorTransform, material, openPosition));
    }