Esempio n. 1
0
 public void Bowl(int pinFall)
 {
     bowls.Add(pinFall);
     ActionMaster.Action nextAction = ActionMaster.NextAction(bowls);
     pinSetter.PerformAction(nextAction);
     bowlingBall.Reset();
 }
Esempio n. 2
0
    public void Bowl(int pinFall)
    {
        ball.Reset();
        // Prevent pins fall adding to List rolls if Endgame.
        if (ActionMaster.NextAction(rolls) == ActionMaster.Action.EndGame)
        {
            Debug.LogWarning("Game ends, please reset.");
            return;
        }
        try{
            rolls.Add(pinFall);
            // Will run through all the list,but will only return the last action.
            pinSetter.SwiperAction(ActionMaster.NextAction(rolls));
        }catch {
            Debug.LogWarning("Error occurs at Bowl()");
        }
        if (ActionMaster.NextAction(rolls) == ActionMaster.Action.EndGame)
        {
            cheatButton.SetActive(true);
            gameOver.SetActive(true);
            Debug.LogWarning("Game ends, please reset.");
        }

        //print ("pinFall is " + pinFall + ", lastSettleCount is " + pinCounter.CountStanding () + ", " + ActionMaster.NextAction (bowls));
//		try{
        scoreDisplay.FillRolls(rolls);
        scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(rolls));

        //scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(rolls));
//		}catch{
//			Debug.LogWarning ("Error occurs at FillRollCard()");
//		}
    }
Esempio n. 3
0
 // Update is called once per frame
 void Update()
 {
     // CountDown to prevent very slow launch to take forever.
     if (startTime > 0 && Time.time > startTime + countDown)
     {
         ball.Reset();
     }
 }
Esempio n. 4
0
    public void Bowl(int pinFall)
    {
        try
        {
            pins.Add(pinFall);
            ball.Reset();
            pinSetter.PerformAction(ActionMaster.NextAction(pins));
        }
        catch
        {
            Debug.LogWarning("Something went wrong with Bowl()");
        }

        try
        {
            scores.FillRollCard(pins);
            scores.FillFrames(ScoreMaster.ScoreCumulative(pins));
        }
        catch { Debug.LogWarning("Something went wrong with FillRollCard()"); }
    }
Esempio n. 5
0
    public void Bowl(int pinFall)
    {
        try {
            rolls.Add(pinFall);
            ball.Reset();
            List <int>          tempRolls  = new List <int>(rolls);
            ActionMaster.Action nextAction = ActionMaster.NextAction(tempRolls);
            pinSetter.PerformAction(nextAction);

            print("Rolls: " + PrintRolls(rolls));
        } catch {
            Debug.LogWarning("Something went wrong in Game Manager");
        }
        try {
            scoreDisplay.FillRolls(rolls);
            scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(rolls));
            //print("Cumulative:" + PrintRolls(ScoreMaster.ScoreCumulative(rolls)));
        } catch {
            Debug.LogWarning("Something went wrong in Score Display");
        }
    }
Esempio n. 6
0
 public void BallReset()
 {
     bowlingBall.Reset();
     standingDisplay.GetComponent <Text>().color = Color.white;
 }
Esempio n. 7
0
 private void ResetBall()
 {
     ball.Reset();
 }