/// <summary> /// End the bonus Stage so that highscores etc can be handled. /// </summary> public void EndBonusStage() { gM_1.PauseGame(); winScreen.SetActive(true); pauseButton.SetActive(false); if (SVM_Script.gameDifficulty == "easy") { tempString = "Easy"; if (SVM_Script.advanceIsLocked) { SVM_Script.advanceIsLocked = false; PlayerPrefs.SetInt("EE_advance", 1); } } else if (SVM_Script.gameDifficulty == "advance") { tempString = "Advance"; if (SVM_Script.expertIsLocked) { SVM_Script.expertIsLocked = false; PlayerPrefs.SetInt("EE_expert", 1); } } else if (SVM_Script.gameDifficulty == "expert") { tempString = "Expert"; } totalScore += bonusScore /* some sort of modification to make it highscore worthy maybe*/; CheckHighScore(); }
/// <summary> /// Checks if the answer is correct and updates that score if it is, otherwise updates the lives. /// </summary> /// <returns><c>true</c> If answer is correct, <c>false</c> otherwise.</returns> /// <param name="ballScoreValue">Ball score value.</param> public bool CheckScore(int ballScoreValue) { //when answer is right if (currentAnswerInSM == playerAnswerInSM) { score += ballScoreValue; DisplayScore(scoreNum1, scoreNum2, score); if (score >= targetScore) { winScreen.SetActive(true); winScreen.GetComponent <Image> ().sprite = winScreenImg; gM_1.PauseGame(); pauseButton.SetActive(false); if (SVM_Script.gameDifficulty == "easy") { tempString = "Easy"; if (SVM_Script.advanceIsLocked) { SVM_Script.advanceIsLocked = false; PlayerPrefs.SetInt("EE_advance", 1); } } else if (SVM_Script.gameDifficulty == "advance") { tempString = "Advance"; if (SVM_Script.expertIsLocked) { SVM_Script.expertIsLocked = false; PlayerPrefs.SetInt("EE_expert", 1); } } else if (SVM_Script.gameDifficulty == "expert") { tempString = "Expert"; } ComputeTotalScore(); //this is for saving highscores } Debug.Log("Correct Answer"); return(true); } //when answer is wrong else { LoseLife(); CheckLives(); return(false); } }