Beispiel #1
0
 void SetDifficulty()
 {
     if (GamePrefences.GetEasyDifficultyState() == 1)
     {
         SetInitialDifficulty("easy");
     }
     if (GamePrefences.GetMediumDifficultyState() == 1)
     {
         SetInitialDifficulty("medium");
     }
     if (GamePrefences.GetHardDifficultyState() == 1)
     {
         SetInitialDifficulty("hard");
     }
 }
Beispiel #2
0
 void ScoreBaseOnDifficulty()
 {
     if (GamePrefences.GetEasyDifficultyState() == 1)
     {
         SetScore(GamePrefences.GetEasyDifficultyHighscore(), GamePrefences.GetEasyDifficultyCoinScore());
     }
     if (GamePrefences.GetMediumDifficultyState() == 1)
     {
         SetScore(GamePrefences.GetMediumDifficultyHighscore(), GamePrefences.GetMediumDifficultyCoinScore());
     }
     if (GamePrefences.GetHardDifficultyState() == 1)
     {
         SetScore(GamePrefences.GetHardDifficultyHighscore(), GamePrefences.GetHardDifficultyCoinScore());
     }
 }
    void Start()
    {
        if (GamePrefences.GetEasyDifficultyState() == 1)
        {
            maxSpeed = easySpeed;
        }
        if (GamePrefences.GetMediumDifficultyState() == 1)
        {
            maxSpeed = mediumSpeed;
        }
        if (GamePrefences.GetHardDifficultyState() == 1)
        {
            maxSpeed = hardSpeed;
        }

        moveCamera = true;
    }
    public void CheckGameStatus(int score, int coinScore, int lifeScore)
    {
        Debug.Log("Chech game status");
        if (lifeScore < 0)
        {
            Debug.Log("LifeSCore<2");
            if (GamePrefences.GetEasyDifficultyState() == 1)
            {
                Debug.Log("GetEasyLevel");
                int highScore     = GamePrefences.GetEasyDifficultyHighscore();
                int coinHighScore = GamePrefences.GetEasyDifficultyCoinScore();
                if (highScore < score)
                {
                    Debug.Log("Score");
                    GamePrefences.SetEasyDifficultyHighscore(score);
                }
                if (coinHighScore < coinScore)
                {
                    Debug.Log("CoinScore");
                    GamePrefences.SetEasyDifficultyCoinScore(coinScore);
                }
            }
            if (GamePrefences.GetMediumDifficultyState() == 1)
            {
                Debug.Log("MediumLevel");
                int highScore     = GamePrefences.GetMediumDifficultyHighscore();
                int coinHighScore = GamePrefences.GetMediumDifficultyCoinScore();

                if (highScore < score)
                {
                    Debug.Log("7");
                    GamePrefences.SetMediumDifficultyHighscore(score);
                }
                if (coinHighScore < coinScore)
                {
                    //  Debug.Log("8");
                    GamePrefences.SetMediumDifficultyCoinScore(coinScore);
                }
            }
            if (GamePrefences.GetHardDifficultyState() == 1)
            {
                Debug.Log("HardLevel");
                int highScore     = GamePrefences.GetHardDifficultyHighscore();
                int coinHighScore = GamePrefences.GetHardDifficultyCoinScore();

                if (highScore < score)
                {
                    //    Debug.Log("10");
                    GamePrefences.SetHardDifficultyHighscore(score);
                }
                if (coinHighScore < coinScore)
                {
                    //  Debug.Log("11");
                    GamePrefences.SetHardDifficultyCoinScore(coinScore);
                }
            }
            gameStartedFromMainMenu     = false;
            gameRestartedAfterPlayerDie = false;

            GamePlyControllar.instance.gameOverShowpenal(score, coinScore);
        }
        else
        {
            //debug.Log("12");
            this.score     = score;
            this.coinScore = coinScore;
            this.lifeScore = lifeScore;

            //GamePlyControllar.instance.SetScore(score );
            //GamePlyControllar.instance.SetCoinScore(coinScore );
            //GamePlyControllar.instance.SetLifeScore(lifeScore );

            gameStartedFromMainMenu     = false;
            gameRestartedAfterPlayerDie = true;
            GamePlyControllar.instance.PlayerDiedRestartedgame();
        }
    }