Example #1
0
    public void Bowl(int pinFall)
    {
        // add pinFall to pins
        pins.Add(pinFall);

        int[] pinArr = pins.ToArray();
        Debug.Log(string.Join(",", pinArr.Select(x => x.ToString()).ToArray()));

        // Call ScoreMaster to get scores
        List <int> scores = ScoreMaster.ScoreFrames(pins);

        // Call ActionMaster
        ActionMaster.Action action = ActionMaster.NextAction(pins);
        Debug.Log("Next Action: " + action);

        // Call PinSetter/Animator
        pinSetter.Animate(action);

        // TODO: Call ScoreDisplay to Display scores

        // Call ball to Reset
        ball.Reset();
    }
Example #2
0
    public void PinFall(int pinsFall)
    {
        try
        {
            rolls.Add(pinsFall);
            pinSetter.Animate(ActionMaster.NextAction(rolls));
            ball.Reset();
        }
        catch
        {
            Debug.Log("Something went wrong in PinFall()");
        }

        try
        {
            scoreDisplay.FillRolls(rolls);
            scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(rolls));
        }
        catch
        {
            Debug.LogWarning("something went wrong in FillRollCards()");
        }
    }