void SetScoreBasedOnDifficulty()
 {
     if (JachTheGiant_GamePreferences.GetEasyDifficultyState() == 1)
     {
         SetScore(JachTheGiant_GamePreferences.GetEasyDifficultyHighScore(), JachTheGiant_GamePreferences.GetEasyDifficultyCoinScore());
     }
     if (JachTheGiant_GamePreferences.GetMediumDifficultyState() == 1)
     {
         SetScore(JachTheGiant_GamePreferences.GetMediumDifficultyHighScore(), JachTheGiant_GamePreferences.GetMediumDifficultyCoinScore());
     }
     if (JachTheGiant_GamePreferences.GetHardDifficultyState() == 1)
     {
         SetScore(JachTheGiant_GamePreferences.GetHardDifficultyHighScore(), JachTheGiant_GamePreferences.GetHardDifficultyCoinScore());
     }
 }
예제 #2
0
 void Start()
 {
     if (JachTheGiant_GamePreferences.GetEasyDifficultyState() == 1)
     {
         maxSpeed = easySpeed;
     }
     if (JachTheGiant_GamePreferences.GetMediumDifficultyState() == 1)
     {
         maxSpeed = mediumSpeed;
     }
     if (JachTheGiant_GamePreferences.GetHardDifficultyState() == 1)
     {
         maxSpeed = hardSpeed;
     }
     moveCamera = true;
 }
    void SetTheDifficulty()
    {
        if (JachTheGiant_GamePreferences.GetEasyDifficultyState() == 1)
        {
            SetInitialDifficulty("easy");
        }

        if (JachTheGiant_GamePreferences.GetMediumDifficultyState() == 1)
        {
            SetInitialDifficulty("medium");
        }

        if (JachTheGiant_GamePreferences.GetHardDifficultyState() == 1)
        {
            SetInitialDifficulty("hard");
        }
    }
    public void CheckGameStatus(int score, int coinScore, int lifeScore)
    {
        if (lifeScore < 0)
        {
            if (JachTheGiant_GamePreferences.GetEasyDifficultyState() == 1)
            {
                int highScore     = JachTheGiant_GamePreferences.GetEasyDifficultyHighScore();
                int coinHighScore = JachTheGiant_GamePreferences.GetEasyDifficultyCoinScore();

                if (highScore < score)
                {
                    JachTheGiant_GamePreferences.SetEasyDifficultyHighScore(score);
                }

                if (coinHighScore < coinScore)
                {
                    JachTheGiant_GamePreferences.SetMediumDifficultyCoinScore(coinScore);
                }
            }

            if (JachTheGiant_GamePreferences.GetMediumDifficultyState() == 1)
            {
                int highScore     = JachTheGiant_GamePreferences.GetMediumDifficultyHighScore();
                int coinHighScore = JachTheGiant_GamePreferences.GetMediumDifficultyCoinScore();

                if (highScore < score)
                {
                    JachTheGiant_GamePreferences.SetMediumDifficultyHighScore(score);
                }

                if (coinHighScore < coinScore)
                {
                    JachTheGiant_GamePreferences.SetMediumDifficultyCoinScore(coinScore);
                }
            }

            if (JachTheGiant_GamePreferences.GetHardDifficultyState() == 1)
            {
                int highScore     = JachTheGiant_GamePreferences.GetHardDifficultyHighScore();
                int coinHighScore = JachTheGiant_GamePreferences.GetHardDifficultyCoinScore();

                if (highScore < score)
                {
                    JachTheGiant_GamePreferences.SetHardDifficultyHighScore(score);
                }

                if (coinHighScore < coinScore)
                {
                    JachTheGiant_GamePreferences.SetHardDifficultyCoinScore(coinScore);
                }
            }
            gameStartedFromMainMenu      = false;
            gameRestartedAfterPlayerDied = false;
            JachTheGiant_GameplayController.instance.GameOverShowPanel(score, coinScore);
        }
        else
        {
            this.score     = score;
            this.coinScore = coinScore;
            this.lifeScore = lifeScore;

            gameStartedFromMainMenu      = false;
            gameRestartedAfterPlayerDied = true;

            JachTheGiant_GameplayController.instance.PlayerDiedRestartTheGame();
        }
    }