public void bowl(int pinFall) { bowls.Add(pinFall); ActionMaster.Action nextAction = ActionMaster.NextAction(bowls); pinSetter.performAction(nextAction); ballMove.reset(); }
public void Bowl(int pinFall) { var endGame = false; try { rolls.Add(pinFall); var actionToPerform = ActionMaster.NextAction(rolls); if (actionToPerform == ActionMaster.Action.EndGame) { endGame = true; } pinSetter.performAction(actionToPerform); ball.Reset(); } catch (Exception) { Debug.LogWarning("Something went wrong in Bowl"); } try { scoreDisplay.FillRolls(rolls); scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(rolls)); if (endGame) { EndGame(); } } catch (Exception ex) { Debug.LogWarning("Something went wrong in FillRolls: " + ex.Message); } }
public void Bowl(int pinFalls) { bowls.Add(pinFalls); ScoreMaster.Action nextAction = ScoreMaster.NextAction(bowls); pinSetter.performAction(nextAction); try { scoreDisplay.FillRollCard(bowls); scoreDisplay.FillFrames(ActionMaster.ScoreCumulatiove(bowls)); } catch { Debug.LogWarning("Error help, pls"); } ball.Reset(); }
public void Bowl(int pinFall) { try { rolls.Add(pinFall); //OLD //ActionMaster.Action nextAction = ActionMaster.NextAction(bowls); //pinSetter.performAction(nextAction); //NEW pinSetter.performAction(ActionMaster.NextAction(rolls)); scoreDisplay.FillRolls(rolls); scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(rolls)); } catch { Debug.LogWarning("Something went wrong in Bowl()"); } ball.Restart(); print("Poszedl bowl z upadnietymi: " + pinFall); }