Esempio n. 1
0
    public void Bowl(int pinFall)
    {
        try
        {
            m_rolls.Add(pinFall);
            BhanuAction.Action nextAction = BhanuAction.NextAction(m_rolls);
            m_pinSetter.PerformAction(nextAction);
            m_ball.Reset();
        }
        catch
        {
            Debug.LogWarning("Sir Bhanu, Something seems to be out of order, in Bowl() Method");
        }

        try
        {
            m_scoreDisplay.FillFrames(ScoreManager.ScoreCumulative(m_rolls));
            m_scoreDisplay.FillRolls(m_rolls);
        }
        catch
        {
            Debug.LogWarning("Sir Bhanu, FillRollCard() Method failed for some reason");
            m_scoreDisplay.FillRolls(m_rolls);
        }
    }
Esempio n. 2
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
            }
        }
    }
Esempio n. 3
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()");
//		}
    }
    public void Bowl(int pinFall)
    {
        try
        {
            bowls.Add(pinFall);

            ActionMasterOld.myAction nextAction = ActionMasterOld.NextAction(bowls);
            pinSetter.PerformAction(nextAction);
            ball.ballReset();
        }
        catch (System.Exception)
        {
            Debug.LogWarning("something wrong with Bowl()");
            throw;
        }

        try
        {
            scoreBoard.FillRolls(bowls);
            scoreBoard.FillFrames(ScoreMaster.ScoreCumulative(bowls));
        }
        catch (System.Exception)
        {
            Debug.LogWarning("FillRollCard failed");
            throw;
        }
    }
Esempio n. 5
0
    public void Bowl(int pinFall)
    {
        Debug.Log("Pinfall: " + pinFall);

        try
        {
            allBowls.Add(pinFall);
            ball.Reset();
            pinSetter.PerformAction(ActionMaster_OLD.NextAction(allBowls));
        }
        catch
        {
            Debug.LogWarning("Something went wrong in Bowl() performing action");
        }

        try
        {
            print("Null score display: " + (scoreDisplay == null));
            print("Null all bowls: " + (allBowls == null));
            scoreDisplay.FillRolls(allBowls);
            scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(allBowls));
        }
        catch
        {
            Debug.LogWarning("Something went wrong in Bowl() filling score card");
        }
    }
Esempio n. 6
0
    public void Bowl(int pinFall)
    {
        rolls.Add(pinFall);
        boxes.Add(pinFall);
        ball.Reset();

        ActionMaster.Action nextAction = ActionMaster.NextAction(boxes);

        if (nextAction == ActionMaster.Action.EndGame)
        {
            finalScore = ScoreMaster.ScoreCumulative(rolls)[9];
            new WaitForSeconds(3);
            sceneLoader.LoadNextScreen();
        }

        pinSetter.TriggerAnimator(nextAction);

        try{
            scoreDisplay.FillRolls(rolls);
            scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(rolls));
        }
        catch {
            Debug.LogWarning("Something went wrong in Fill Rolls method");
        }
    }
    public void Bowl(int pinFall)
    {
        try
        {
            rolls.Add(pinFall);

            ball.Reset();

            pinSetter.PerformAction(ActionMaster.NextAction(rolls));
        }
        catch
        {
            Debug.LogWarning("Something wrong in Bowl()");
        }

        try
        {
            //update the score board
            scoreDisplay.FillRolls(rolls);
            scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(rolls));
        }
        catch
        {
            Debug.LogWarning("FillRollCard() failed.");
        }
    }
 public void Bowl(int pinFall)
 {
     bowls.Add(pinFall);
     ball.Reset();
     pinSetter.PreformAction(ActionMaster.NextAction(bowls));
     scoreDisplay.FillRolls(bowls);
     scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(bowls));
 }
Esempio n. 9
0
 public void Bowl(int pinfall)
 {
     pinFalls.Add(pinfall);
     ball.Reset();
     pinSetter.AnimationCall(ActionMaster.NextAction(pinFalls));
     scoreDisplay.FillRolls(pinFalls);
     scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(pinFalls));
 }
Esempio n. 10
0
 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();
 }
Esempio n. 11
0
    public void Bowl(int pinFall)
    {
        _rolls.Add(pinFall);
        var actionToPerform = ActionMaster.NextAction(_rolls);

        _pinSetter.PerformAction(actionToPerform);
        _scoreDisplay.FillRolls(_rolls);
        _scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(_rolls));
        _ball.Reset();
    }
Esempio n. 12
0
    public void Bowl(int pinFall)
    {
        Debug.Log(pinFall);
        rolls.Add(pinFall);
        ball.Reset();
        pinSetter.PerformAction(ActionMaster.NextAction(rolls));

        scoreDisplay.FillRolls(rolls);
        scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(rolls));
    }
Esempio n. 13
0
    public void Bowl(int pinFall)
    {
        ballsound.ResetSound();
        ball.Reset();
        cam.ResetCamera();
        rolls.Add(pinFall);
        NextAction(rolls);

        scoreDisplay.FillRolls(rolls);
        scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(rolls));
    }
Esempio n. 14
0
 public void Bowl(int pinFall)
 {
     pinFalls.Add(pinFall);
     ps.ActionExcecutor(ActionMaster.NextAction(pinFalls));
     try {
         sD.FillRolls(pinFalls);
         sD.FillFrames(ScoreMaster.ScoreCumulative(pinFalls));
     } catch {
         Debug.LogWarning("FillRollCard failed");
     }
     b.reset();
 }
Esempio n. 15
0
    public void Bowl(int pinFall)
    {
        rolls.Add(pinFall);
        List <int> rollHolder = new List <int> (rolls);

        ball.Reset();

        pinSetter.PerformAction(ActionMaster.NextAction(rollHolder));

        scoreDisplay.FillRolls(rolls);
        scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(rolls));
    }
Esempio n. 16
0
    public void Bowl(int pinFall)
    {
        bowls.Add(pinFall);
        pinSetter.PerformAction(ActionMaster.NextAction(bowls));
        ball.Reset();

        try {
            scoreDisplay.FillRolls(bowls);
            scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(bowls));
        } catch {
            Debug.LogWarning("Error in scoring");
        }
    }
Esempio n. 17
0
    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();
    }
Esempio n. 18
0
 public void Bowl(int pinFall)
 {
     rolls.Add(pinFall);
     ball.Reset();
     pinSetter.PerformAction(ActionMasterOld.NextAction(rolls));
     try
     {
         scoreDisplay.FillRolls(rolls);
         scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(rolls));
     }
     catch
     {
         Debug.LogWarning("something went wrong");
     }
 }
Esempio n. 19
0
    // Processes scoring
    public void Bowl(int pinFall)
    {
        // Process bowl
        rolls.Add(pinFall);
        boxes.Add(pinFall);
        ball.Reset();

        // Pass animation trigger
        pinSetter.ProcessAction(ActionMaster.NextAction(boxes));

        // Fill scorecard
        totalScore = ScoreMaster.ScoreCumulative(rolls);
        scoreDisplay.FillRolls(rolls);
        scoreDisplay.FillFrames(totalScore);
        TotalScore();
    }
    public void Bowl(int pinFall)
    {
        _rolls.Add(pinFall);
        _ball.Reset();
        _pinSetter.PerformAction(ActionMaster.NextAction(_rolls));

        try
        {
            _scoreDisplay.FillRolls(new List <int>());
            _scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(_rolls));
        }
        catch (System.Exception ex)
        {
            Debug.LogWarning(ex);
        }
    }
Esempio n. 21
0
 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");
     }
 }
Esempio n. 22
0
 public void Bowl(int pinFall)
 {
     try{
         rolls.Add(pinFall);
         boxes.Add(pinFall);
         ball.Reset();
         pinSetter.PerformAction(ActionMaster.NextAction(boxes));
     } catch {
         Debug.LogWarning("Something went wrong in Bowl()");
     }
     try{
         scoreDisplay.FillRolls(rolls);
         scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(rolls));
     } catch {
         Debug.LogWarning("FillRollCard not working");
     }
 }
Esempio n. 23
0
    public void Bowl(int pinfall)
    {
        try{
            rolls.Add(pinfall);
            ball.Reset();
            pinSetter.PerformAction(ActionMasterOld.NextAction(rolls));
        } catch {
            Debug.LogWarning("Gamemanager is bad!");
        }

        try{
            scoreDisplay.FillRolls(rolls);
            scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(rolls));
        } catch {
            Debug.LogWarning("ScoreDisplay sucks hard!");
        }
    }
Esempio n. 24
0
    public void Bowl(int pinFall)
    {
        try {
            rolls.Add(pinFall);
            ball.Reset();
            pinsetter.PinSetterAction(ActionManager.NextAction(rolls[rolls.Count - 1]));
        } catch {
            Debug.LogWarning("Something went wrong with Bowl()");
        }

        try {
            scoreDisplay.FillRolls(rolls);
            scoreDisplay.FillFrames(ScoreManager.ScoreCumulative(rolls));
        } catch {
            Debug.LogWarning("Something went wrong with FillRollCard()");
        }
    }
Esempio n. 25
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
        }
    }
Esempio n. 26
0
 public void Bowl(int pinFall)
 {
     pinFalls.Add(pinFall);
     ActionMaster2.Action nextAction = ActionMaster2.NextAction(pinFalls);
     pinSetter.PerformAction(nextAction);
     try
     {
         scoreDisplay.FillRolls(pinFalls);
         scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(pinFalls));
     }
     catch
     {
         Debug.LogWarning("Something went wrong in Bowl()");
     }
     ball.Reset();
     dragLaunch.Reset();
 }
Esempio n. 27
0
    public void Bowl(int pinFall)
    {
        try{
            bowls.Add(pinFall);
            ball.Reset();


            pinSetter.PerformAction(ActionMaster.NextAction(bowls));
        }catch {
            Debug.Log("Error occurred in this function(Bowl).");
        }

        try{
            scoreDisplay.FillRolls(bowls);
        }catch {
            Debug.Log("The Score Display has a error.");
        }
    }
    public void Bowl(int pinFall)
    {
        rolls.Add(pinFall);
        ball.Reset();

        ActionMaster.Action nextAction = ActionMaster.NextAction(rolls);
        pinSetter.TakeAction(nextAction);

        scoreDisplay.FillRolls(rolls);
        scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(rolls));

        if (ScoreMaster.ScoreCumulative(rolls).Count >= 10)
        {
            gameOver = true;
            touchPanel.SetActive(false);
            resetPanel.gameObject.SetActive(true);
            resetPanel.SetFinalScore(ScoreMaster.ScoreCumulative(rolls)[9]);
        }
    }
Esempio n. 29
0
    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);
    }
Esempio n. 30
0
    public void Bowl(int pinFall)
    {
        try  {
            rolls.Add(pinFall);
            ball.Reset();

            ActionMaster.Action nextAction = ActionMaster.NextAction(rolls);
            pinSetter.PerformAction(nextAction);
        } catch {
            Debug.LogWarning("Something went awry in GameManager.Bowl()");
        }

        try {
            scoreDisplay.FillRolls(rolls);
            scoreDisplay.FillFrames(ScoreMaster.ScoreCumulative(rolls));
        } catch {
            Debug.LogWarning("Something went awry in GameManger.Bowl() line 32 [scoreDisplay.FillRollCard (bowls);]");
        }
    }