public void Bowl(int pinFall) { bowls.Add(pinFall); ActionMaster.Action nextAction = ActionMaster.NextAction(bowls); pinSetter.PerformAction(nextAction); bowlingBall.Reset(); }
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()"); // } }
// 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(); } }
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()"); } }
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"); } }
public void BallReset() { bowlingBall.Reset(); standingDisplay.GetComponent <Text>().color = Color.white; }
private void ResetBall() { ball.Reset(); }