public void update() {
        updateProjectiles();
        if (reloadCycle < 1) {
            reloadCycle += reloadSpeed;
        }
        if (target == null) {
            if (!findTarget()) {
                angle += da;
                angle %= 2 * Math.PI;
            }
        } else {
            double targetAngle = Math.atan2(target.getTileY() - tileY - 0.5, target.getTileX() - tileX - 0.5);
            turnTowardsTarget(targetAngle);
            if (reloadCycle >= 1 && angle == targetAngle) {
                fireAt(target.getCurrentTile());
                reloadCycle = 0;
            }
            if (!activeArea.contains(target.getCurrentTile()) || target.isDestroyed()) {
                target = null;
            }
        }
    }