Пример #1
0
    void SetDifficulty()
    {
        if (GamePeferences.GetEasyDifficulty() == 1)
        {
            SetInitialDifficulty("easy");
        }

        if (GamePeferences.GetMediumDifficulty() == 1)
        {
            SetInitialDifficulty("medium");
        }

        if (GamePeferences.GetHardDifficulty() == 1)
        {
            SetInitialDifficulty("hard");
        }
    }
    void SetScoreByDifficulty()
    {
        if (GamePeferences.GetEasyDifficulty() == 1)
        {
            SetScore(GamePeferences.GetEasyDiffScore(), GamePeferences.GetEasyDiffCoinScore());
        }

        if (GamePeferences.GetMediumDifficulty() == 1)
        {
            SetScore(GamePeferences.GetMediumDiffScore(), GamePeferences.GetMediumDiffCoinScore());
        }

        if (GamePeferences.GetHardDifficulty() == 1)
        {
            SetScore(GamePeferences.GetHardDiffScore(), GamePeferences.GetHardDiffCoinScore());
        }
    }
Пример #3
0
    // Use this for initialization
    void Start()
    {
        if (GamePeferences.GetEasyDifficulty() == 1)
        {
            maxSpeed = easySpeed;
        }
        if (GamePeferences.GetMediumDifficulty() == 1)
        {
            maxSpeed = mediumSpeed;
        }
        if (GamePeferences.GetHardDifficulty() == 1)
        {
            maxSpeed = hardSpeed;
        }


        moveCamera = true;
    }
Пример #4
0
    public void CheckGameStatus(int score, int coinScore, int lifeScore)
    {
        //GameOVER
        if (lifeScore < 0)
        {
            //From Prefeences
            if (GamePeferences.GetEasyDifficulty() == 1)
            {
                int _score = GamePeferences.GetEasyDiffScore();
                int _coin  = GamePeferences.GetEasyDiffCoinScore();

                if (_score < score)
                {
                    GamePeferences.SetEasyDiffScore(score);
                }

                if (_coin < coinScore)
                {
                    GamePeferences.SetEasyDiffCoinScore(coinScore);
                }
            }

            if (GamePeferences.GetMediumDifficulty() == 1)
            {
                int _score = GamePeferences.GetMediumDiffScore();
                int _coin  = GamePeferences.GetMediumDiffCoinScore();

                if (_score < score)
                {
                    GamePeferences.SetMediumDiffScore(score);
                }

                if (_coin < coinScore)
                {
                    GamePeferences.SetMediumDiffCoinScore(coinScore);
                }
            }

            if (GamePeferences.GetHardDifficulty() == 1)
            {
                int _score = GamePeferences.GetHardDiffScore();
                int _coin  = GamePeferences.GetHardDiffCoinScore();

                if (_score < score)
                {
                    GamePeferences.SetHardDiffScore(score);
                }

                if (_coin < coinScore)
                {
                    GamePeferences.SetHardDiffCoinScore(coinScore);
                }
            }

            RestartGamePlayerDied = false;
            NewGameFomMainMenu    = false;

            GamePlayManager.Instance.GameOverShowFinalScore(coinScore, score);
        }
        else
        {//Still have lifes
            sessionScore     = score;
            sessionCoinScore = coinScore;
            sessionLifeScore = lifeScore;

            NewGameFomMainMenu    = false;
            RestartGamePlayerDied = true;

            GamePlayManager.Instance.PlayerDiedRestartGame();
        }
    }