Exemplo n.º 1
0
    public void HardDifficulty()
    {
        //Storing data in GamePeferences!!
        GamePeferences.SetEasyDifficulty(0);
        GamePeferences.SetMediuDifficulty(0);
        GamePeferences.SetHardDifficulty(1);

        easySign.SetActive(false);
        mediumSign.SetActive(false);
        hardSign.SetActive(true);
    }
 void CheckToPlayMusic()
 {
     if (GamePeferences.GetMusic() == 1)
     {
         MusicManager.Instance.PlayMusic(true);
         musicButton.image.sprite = musicIcons[1];
     }
     else
     {
         MusicManager.Instance.PlayMusic(false);
         musicButton.image.sprite = musicIcons[0];
     }
 }
 public void Music()
 {
     if (GamePeferences.GetMusic() == 0)
     {
         GamePeferences.SetMusic(1);
         MusicManager.Instance.PlayMusic(true);
         musicButton.image.sprite = musicIcons[1];
     }
     else
     {
         GamePeferences.SetMusic(0);
         MusicManager.Instance.PlayMusic(false);
         musicButton.image.sprite = musicIcons[0];
     }
 }
Exemplo n.º 4
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());
        }
    }
Exemplo n.º 6
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;
    }
Exemplo n.º 7
0
    private void InitializeGamePref()
    {
        if (!PlayerPrefs.HasKey("DRH Game Init 1"))
        {
            GamePeferences.SetEasyDifficulty(0);
            GamePeferences.SetEasyDiffScore(0);
            GamePeferences.SetEasyDiffCoinScore(0);
            //Default
            GamePeferences.SetMediuDifficulty(1); // true
            GamePeferences.SetMediumDiffScore(0);
            GamePeferences.SetMediumDiffCoinScore(0);

            GamePeferences.SetHardDifficulty(0);
            GamePeferences.SetHardDiffScore(0);
            GamePeferences.SetHardDiffCoinScore(0);

            GamePeferences.SetMusic(1); //on

            //Il pacalim prin salvaea de cheie
            PlayerPrefs.SetInt("DRH Game Init 1", 1);
        }
    }
Exemplo n.º 8
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();
        }
    }