void Awake() { instance = this; bGo1 = true; bGo2 = true; bGo3 = true; }
public static int HighestScore(gameMode gameMode, gameDifficulty gameDifficulty) { OrderGameScore(); int type = ModeDifficultyToInt(gameMode, gameDifficulty); if (type > 0) { return highScore[type][0].Value; } else { return 0; } }
//Function called from the New Game screen in the main menu. Sets the difficulty for the new game public void SetGameDifficulty(int difficulty_) { switch (difficulty_) { case 0: this.currentDifficulty = gameDifficulty.Easy; break; case 1: this.currentDifficulty = gameDifficulty.Normal; break; case 2: this.currentDifficulty = gameDifficulty.Hard; break; default: this.currentDifficulty = gameDifficulty.Normal; break; } }
void gameDifficultyMenuEntrySelected(object sender, PlayerIndexEventArgs e) { currentGameDifficulty++; if (currentGameDifficulty > gameDifficulty.Hard) currentGameDifficulty = 0; SetMenuEntryText(); }
private static int ModeDifficultyToInt(gameMode gameMode, gameDifficulty gameDifficulty) { if (gameMode == gameMode.Classic && gameDifficulty == gameDifficulty.Easy) { return 0; } if (gameMode == gameMode.Classic && gameDifficulty == gameDifficulty.Hard) { return 1; } if (gameMode == gameMode.Arcade && gameDifficulty == gameDifficulty.Easy) { return 2; } if (gameMode == gameMode.Arcade && gameDifficulty == gameDifficulty.Hard) { return 3; } return -1; }
public static void PutHighScore(string playerName, int gameScore, gameMode gameMode, gameDifficulty gameDifficulty) { int type = ModeDifficultyToInt(gameMode, gameDifficulty); if (type == -1) return; if (IsInHighscores(gameScore, type)) { highScore[type][highscorePlaces - 1] = new KeyValuePair<string, Int32>(playerName, gameScore); OrderGameScore(); } }