private void rotateEnemy() {
        
        float rotation = enemy.getRotation();
        float wRotation = (float) Math.PI * 2 - rotation;
        float angle = getRelativeAngle();
        if (angle > Math.PI * (3 / 2)) {
            angle -= 2 * Math.PI;
        }
        if (wRotation > Math.PI * (3 / 2)) {
            wRotation -= 2 * Math.PI;
        }

        if (wRotation < angle) {
            if (angle - wRotation > Math.PI) {
                rotation+= Math.toRadians(1);
            } else {
                rotation-= Math.toRadians(1);
            }
            if (rotation < 0) {
                rotation = (float) Math.PI * 2;
            }

        } else if (wRotation > angle) {
            if (wRotation - angle > Math.PI) {
                rotation -= Math.toRadians(1);
            } else {
                rotation += Math.toRadians(1);
            }
            if (rotation > 2 * Math.PI) {
                rotation = 0;
            }
        }
        enemy.setRotation(rotation); 
    }