void PinsHaveSettled() { int pinFall = lastSettledCount - CountStanding(); lastSettledCount = CountStanding(); ActionMaster.Action action = actionMaster.Bowl(pinFall); Debug.Log("pinFall: " + pinFall + " Action: " + action); if (action == ActionMaster.Action.Tidy) { animator.SetTrigger("tidyTrigger"); } else if (action == ActionMaster.Action.EndTurn || action == ActionMaster.Action.Reset) { lastSettledCount = 10; animator.SetTrigger("resetTrigger"); } else if (action == ActionMaster.Action.EndGame) { throw new UnityException("Don't know how to handle end game yet"); } ball.Reset(); lastStandingCount = -1; // Indicates opins have settled ballOutOfPlay = false; standingDisplay.color = Color.green; }
public ActionMasterTest() { endTurn = ActionMaster.Action.EndTurn; tidy = ActionMaster.Action.Tidy; reset = ActionMaster.Action.Reset; endGame = ActionMaster.Action.EndGame; }
public void Bowl(int pinFall) { bowls.Add(pinFall); ActionMaster.Action nextAction = ActionMaster.NextAction(bowls); pinSetter.PerformAction(nextAction); ball.Reset(); }
public void Bowl(int pinfall) { bowls.Add(pinfall); ActionMaster.Action nextAction = ActionMaster.NextAction(bowls); ps.PerformAction(nextAction); sd.FillRolls(bowls); sd.FillFrames(ScoreMaster.ScoreCumulative(bowls)); bm.reset(); }
public void Bowl(int pinFall) { bowls.Add(pinFall); ball.Reset(); ActionMaster.Action nextAction = ActionMaster.NextAction(bowls); pinSetter.PerformAction(nextAction); scoreDisplay.FillRollCard(bowls); }
public void Animate(ActionMaster.Action action) { if (action == ActionMaster.Action.Reset || action == ActionMaster.Action.EndTurn) { animator.SetTrigger("resetTrigger"); } else if (action == ActionMaster.Action.Tidy) { animator.SetTrigger("tidyTrigger"); } }
public void PinMachine(ActionMaster.Action action) { if (action == ActionMaster.Action.Tidy) { animator.SetTrigger("tidyTrigger"); } else if (action == ActionMaster.Action.Reset || action == ActionMaster.Action.EndTurn || action == ActionMaster.Action.EndGame) { animator.SetTrigger("resetTrigger"); pinCounter.Reset(); //Resets to 10 pins standing } }
//void CheckStandingCount() //{ // int count = CountStanding(); // if (lastStandingCount != count) // { // lastStandingCount = count; // lastChangeTime = Time.time; // return; // } // if (Time.time - lastChangeTime >= 3f) // { // PinsHaveSettled(); // } //} //void PinsHaveSettled() //{ // int standingPins = CountStanding(); // int pinsFall = lastSettledCount - standingPins; // lastSettledCount = standingPins; // // Take Action // ActionMaster.Action action = actionMaster.Bowl(pinsFall); // TakeAction(action); // lastStandingCount = -1; // ballOutOfPlay = false; // numOfStandingPins.color = Color.green; // ball.Reset(); //} public void PerformAction(ActionMaster.Action action) { if (action == ActionMaster.Action.TIDY) { animator.SetTrigger("tidyTrigger"); } else if (action == ActionMaster.Action.RESET || action == ActionMaster.Action.END_TURN) { pinCounter.Reset(); animator.SetTrigger("resetTrigger"); } }
public void Animation(ActionMaster.Action action) { if (ActionMaster.Action.EndTurn == action || ActionMaster.Action.Reset == action) { animator.SetTrigger("ResetTrigger"); pinCounter.LastSettleCountReset(); } else { animator.SetTrigger("TidyTrigger"); } }
public void Bowl(int pinFall) { rolls.Add(pinFall); ActionMaster.Action nextAction = ActionMaster.NextAction(rolls); if (nextAction == ActionMaster.Action.EndGame) { levelManager.LoadNextLevel(); } pinSetter.Animation(nextAction); scoreDisplay.FillRollCard(rolls); scoreDisplay.FillScores(ScoreMaster.ScoreCumulative(rolls)); ball.BallReset(); }
public void Bowl(int pinFall) { bowls.Add(pinFall); //Adiciona a jogada à lista "pins" ActionMaster.Action action = ActionMaster.NextAction(bowls); pinSetter.triggerAnimation(action); List <int> frameScores = ScoreMaster.ScoreCumulative(bowls); scoreDisplay.FillFrames(frameScores); scoreDisplay.FillRolls(bowls); ball.Reset(); }
public void Bowl(int pinFall) { bowls.Add(pinFall); ActionMaster.Action nextAction = ActionMaster.NextAction(bowls); pinSetter.HandleAction(nextAction); ball.Reset(); try { scoreDisplay.FillBowls(bowls); scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(bowls)); } catch { Debug.LogError("Could not fill roll card"); } }
private void SetPinCounterMaxPinsForCurrentRollBasedOnNextAction(ActionMaster.Action nextAction, int pinsKnockedDown) { if (nextAction == ActionMaster.Action.Tidy) { pinCounter.SetMaxPinsForCurrentRoll(INITIAL_PIN_COUNT - pinsKnockedDown); } else if (nextAction == ActionMaster.Action.Reset || nextAction == ActionMaster.Action.EndTurn) { pinCounter.SetMaxPinsForCurrentRoll(INITIAL_PIN_COUNT); } else if (nextAction == ActionMaster.Action.EndGame) { throw new UnityException("Don't know how to handle EndGame!"); } }
// TODO move to GameMaster when ready public void PinsHaveSettled(int pinsFallen) { scoreList.Add(pinsFallen); //ActionMaster.Action action = actionMaster.Bowl(pinsFallen); // take action based on last round (if first frame) ActionMaster.Action action = ActionMaster.NextAction(scoreList); // variable size scorelist??! holy shit does that work? pinSetter.PerformAction(action); print(pinsFallen); print(action); ball.Reset(); }
public void PerformAction(ActionMaster.Action actionToPerform) { if (actionToPerform == ActionMaster.Action.Tidy) { animator.SetTrigger("tidyTrigger"); } else if (actionToPerform == ActionMaster.Action.Reset || actionToPerform == ActionMaster.Action.EndTurn) { animator.SetTrigger("resetTrigger"); } else if (actionToPerform == ActionMaster.Action.EndGame) { throw new UnityException("Don't know how to handle EndGame!"); } }
// Lane performs next action based on list of bowls and // handles edge case actions private void NextAction() { // Get next action and set pins ActionMaster.Action nextAction = ActionMaster.NextAction(bowls); pinSetter.SetPins(nextAction); if (nextAction != ActionMaster.Action.Tidy) { lastSettledCount = 10; } if (nextAction == ActionMaster.Action.EndGame) { Invoke("LoadEndScreen", 5); } }
public void ActionExcecutor(ActionMaster.Action act) { if (act == ActionMaster.Action.Tidy) { aN.SetTrigger("TidyTrigger"); raising = true; } else if (act == ActionMaster.Action.EndTurn || act == ActionMaster.Action.Reset) { aN.SetTrigger("ResetTrigger"); pc.Reset(); } else if (act == ActionMaster.Action.EndGame) { } }
// Control animation triggers based on ActionMaster action public void SetPins(ActionMaster.Action action) { Debug.Log(action); switch (action) { case ActionMaster.Action.Tidy: animator.SetTrigger("tidyTrigger"); break; case ActionMaster.Action.EndGame: case ActionMaster.Action.EndTurn: case ActionMaster.Action.Reset: animator.SetTrigger("resetTrigger"); break; } }
public void PerformAction(ActionMaster.Action action) { if (action == ActionMaster.Action.Tidy) { animator.SetTrigger("tidyTrigger"); } else if (action == ActionMaster.Action.Reset || action == ActionMaster.Action.EndTurn) { animator.SetTrigger("resetTrigger"); pinCounter.Reset(); } else if (action == ActionMaster.Action.EndGame) { throw new UnityException("Endgame not implemented yet"); } }
public void PerformAction(ActionMaster.Action action) { if (action == ActionMaster.Action.Tidy) { anim.SetTrigger("triggerCleanUp"); } else if (action == ActionMaster.Action.EndGame) { throw new UnityException("Not sure how to handle END GAME scenario"); } else { anim.SetTrigger("triggerReset"); pinCounter.Reset(); } }
public void PerformAction(ActionMaster.Action action) { if (action == ActionMaster.Action.Tidy) { animator.SetTrigger("tidyTrigger"); } else if (action == ActionMaster.Action.Reset || action == ActionMaster.Action.EndTurn) { pinCounter.Reset(); animator.SetTrigger("resetTrigger"); } else if (action == ActionMaster.Action.EndGame) { throw new UnityException("Don't know how to handle end game yet"); } }
private void PinsHaveSettled() { int standing = CountStanding(); int pinFall = lastSettleCount - standing; lastSettleCount = standing; ActionMaster.Action action = actionMaster.Bowl(pinFall); HandleAction(action); Debug.Log("Pinfall: " + pinFall + " " + action); ball.Reset(); lastStandingCount = -1; //indicates pins have settled, and ball not back in box ballLeftBox = false; standingDisplay.color = Color.green; }
public void Bowl(int pinFall) { bowls.Add(pinFall); ActionMaster.Action nextAction = ActionMaster.NextAction(bowls); pinSetter.PerformAction(nextAction); try { scoreDisplay.UpdateScore(bowls, ScoreMaster.ScoreFrames(bowls)); } catch (UnityException e) { Debug.Log("Unable to upate score."); Debug.Log(e.ToString()); } ball.Reset(); }
public void Bowl(int pinFall) { try{ rolls.Add(pinFall); ball.Reset(); ActionMaster.Action nextAction = ActionMaster.NextAction(rolls); pinSetter.PerformAction(nextAction); }catch { Debug.LogWarning("Error"); } try{ scoreDisplay.FillRolls(rolls); scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(rolls)); }catch { Debug.LogWarning("fillrollcards failed"); } }
public void Bowl(int fallenPins) { bowlsList.Add(fallenPins); ball.Reset(); List <int> modListPlayerOne = ScoreMaster.ScoreFramesHelper(bowlsList); scoreDisplay.FillRolls(modListPlayerOne); scoreDisplay.FillFrames(modListPlayerOne); ActionMaster.Action nextAction = ActionMaster.NextAction(this.bowlsList); pinSetter.PinsHaveSetteled(nextAction); if (nextAction == ActionMaster.Action.EndGame) { playerFinalScore = scoreDisplay.finalScore; SetHighestScoringPlayerInGameMode(); Invoke("LoadNextLevel", 5f); // loads leaderboard scene } }
public void PinsHaveSetteled(ActionMaster.Action actionToTake) { if (actionToTake == ActionMaster.Action.EndGame) { //throw new UnityException ("End Game"); this.ResetTrigger(); pinCounter.ResetSettleCount(); } if (actionToTake == ActionMaster.Action.Tidy) { this.TidyTrigger(); } else { this.ResetTrigger(); pinCounter.ResetSettleCount(); } }
public void PerformAction(ActionMaster.Action action) { if (action == ActionMaster.Action.Tidy) { animator.SetTrigger("tidyTrigger"); pinCounter.ResetLastSettled(false); } else if (action == ActionMaster.Action.EndTurn) { animator.SetTrigger("resetTrigger"); pinCounter.ResetLastSettled(true); } else // need to expand to consider other actions, but fine for now { animator.SetTrigger("resetTrigger"); pinCounter.ResetLastSettled(true); } }
public void Bowl(int pinFall) { try{ bowls.Add(pinFall); ActionMaster.Action nextAction = ActionMaster.NextAction(bowls); pinSetter.PerformAction(nextAction); } catch { Debug.LogWarning("Something went wrong in Bowl"); } try{ scoreDisplay.FillBowls(bowls); scoreDisplay.FillFrameScores(ScoreMaster.ScoreCumulative(bowls)); } catch { Debug.LogWarning("FillRollCard Failed"); } ball.Reset(); inPlayTime = 25f; GameOver(); }
// Update is called once per frame public void Bowls(int pinFall) { try{ rolls.Add(pinFall); ball.Reset(); ActionMaster.Action nextAction = ActionMaster.NextAction(rolls); pinSetter.PerformAction(nextAction); }catch { Debug.Log("There is some problem in performing action"); } try{ scoreDisplay.FillRollCard(rolls); scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(rolls)); } catch { Debug.Log("There's an error while fiiling the score card"); } }
public void performAction(ActionMaster.Action action) { Debug.Log("Action: " + action); switch (action) { case ActionMaster.Action.Tidy: animator.SetTrigger("tidyTrigger"); break; case ActionMaster.Action.Reset: case ActionMaster.Action.EndTurn: case ActionMaster.Action.EndGame: animator.SetTrigger("resetTrigger"); pinCounter.Reset(); break; } }
public void DoAction(ActionMaster.Action action) { Debug.Log("DoAction: " + action); switch (action) { case ActionMaster.Action.Tidy: this.Tidy(); this.pinCounter.Reset(); break; case ActionMaster.Action.Reset: case ActionMaster.Action.EndTurn: this.Reset(); this.pinCounter.Reset(endTurn: true); break; } }