示例#1
0
    private void PlayerMoveTwoPlayers(int fallenPins, List <int> bowls, bool hasThisPlayerFinishedBowling, bool hasTheOtherPlayerFinishedBowling,
                                      ScoreDisplay playerScoreDisplay, ScoreDisplay otherPlayerScoreDisplay, int playerFinalScore)
    {
        bowls.Add(fallenPins);
        ActionMaster.Action nextAction = ActionMaster.NextAction(bowls);
        pinSetter.PinsHaveSetteled(nextAction);
        ball.Reset();
        List <int> modBowls = ScoreMaster.ScoreFramesHelper(bowls);

        playerScoreDisplay.FillRolls(modBowls);
        playerScoreDisplay.FillFrames(modBowls);
        if (nextAction == ActionMaster.Action.EndTurn)
        {
            thisPlayerTurn = !thisPlayerTurn;
            SwitchBallSkin();
            playerScoreDisplay.gameObject.GetComponent <Image> ().color      = originalBoardColor;
            otherPlayerScoreDisplay.gameObject.GetComponent <Image> ().color = yellowBoardColor;
        }
        if (nextAction == ActionMaster.Action.EndGame)
        {
            hasThisPlayerFinishedBowling = true;
            if (hasTheOtherPlayerFinishedBowling)
            {
                playerFinalScore = playerScoreDisplay.finalScore;
                SetHighestScoringPlayerInGameMode();
                Invoke("LoadNextLevel", 5f);                    // loads leaderboard scene
            }
        }
    }
示例#2
0
    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
        }
    }