package edu.stuy.starlorn.upgrades;

public class DoubleShotUpgrade extends GunUpgrade {
    private boolean _shotNum;

    public DoubleShotUpgrade() {
        super();
        _shotNum = false;
    }

    @Override
    public int getNumShots() {
        return 2;
    }

    @Override
    public double getAimAngle() {
        int direction = 0;
        if (_shotNum) {
            _shotNum = !_shotNum;
            direction = 1;
        } else if (!_shotNum) {
            _shotNum = !_shotNum;
            direction = -1;
        }
        return direction * Math.PI/8;
    }
}

package edu.stuy.starlorn.upgrades;

public class DoubleShotUpgrade extends GunUpgrade {
    private boolean _right;

    public DoubleShotUpgrade() {
        super();
        _right = true;
    }

    @Override
    public int getNumShots() {
        return 2;
    }

    @Override
    public double getAimAngle() {
        int direction = 0;
        if (_right) {
            _right = !_right;
            direction = 1;
        } else if (!_right) {
            _right = !_right;
            direction = -1;
        }
        return direction * Math.PI/8;
    }
}

Rename _shotNum to _right in DoubleShot