package edu.stuy.starlorn.upgrades;

public class DoubleShotUpgrade extends GunUpgrade {
    private int _shotNum;

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

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

    @Override
    public double getAimAngle() {
        if (_shotNum == 0) {
            _shotNum++;
            return Math.PI/8;
        } else if (_shotNum == 1) {
            _shotNum--;
            return -Math.PI/8;
        } else { // If those failed, something weird is going on, reset and aim straight.
            _shotNum = 0;
            return 0;
        }
    }
}

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;
    }
}

Change DoubleShot to use a boolean
Change DoubleShot to use a boolean
