public void hardDifficulty() { GamePrefences.SetEasyDifficultyState(0); GamePrefences.SetMediumDifficultyState(0); GamePrefences.SetHardDifficultyState(1); EasySign.SetActive(false); MediumSign.SetActive(false); HardSign.SetActive(true); }
void CheckToPlayTheMusic() { if (GamePrefences.GetMusicState() == 1) { MusicControllar.instance.playMusic(true); musicbutton.image.sprite = musicIcons[1]; } else { MusicControllar.instance.playMusic(false); musicbutton.image.sprite = musicIcons[0]; } }
void SetDifficulty() { if (GamePrefences.GetEasyDifficultyState() == 1) { SetInitialDifficulty("easy"); } if (GamePrefences.GetMediumDifficultyState() == 1) { SetInitialDifficulty("medium"); } if (GamePrefences.GetHardDifficultyState() == 1) { SetInitialDifficulty("hard"); } }
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()); } }
public void MusicButton() { if (GamePrefences.GetMusicState() == 0) //false { GamePrefences.SetMusicState(1); //true MusicControllar.instance.playMusic(true); musicbutton.image.sprite = musicIcons[1]; } else if (GamePrefences.GetMusicState() == 1) //currently playing { GamePrefences.SetMusicState(0); //true MusicControllar.instance.playMusic(false); musicbutton.image.sprite = musicIcons[0]; } }
void Start() { if (GamePrefences.GetEasyDifficultyState() == 1) { maxSpeed = easySpeed; } if (GamePrefences.GetMediumDifficultyState() == 1) { maxSpeed = mediumSpeed; } if (GamePrefences.GetHardDifficultyState() == 1) { maxSpeed = hardSpeed; } moveCamera = true; }
void InitializeVariable() { if (!PlayerPrefs.HasKey("Game Initialized")) { GamePrefences.SetEasyDifficultyState(0); GamePrefences.SetHardDifficultyCoinScore(0); GamePrefences.SetEasyDifficultyHighscore(0); GamePrefences.SetMediumDifficultyState(1); GamePrefences.SetMediumDifficultyCoinScore(0); GamePrefences.SetMediumDifficultyHighscore(0); GamePrefences.SetHardDifficultyState(1); GamePrefences.SetHardDifficultyCoinScore(0); GamePrefences.SetHardDifficultyCoinScore(0); GamePrefences.SetMusicState(0); PlayerPrefs.SetInt("Game Initialized", 123); } }
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(); } }
void Start() { SetDifficulty(); GamePrefences.SetMusicState(0); }