public void Initialize(CameraController cameraController, GameDifficultyMode difficultyMode) { _worldGenerator = GetWorldGenerator(difficultyMode); if (_worldGenerator != null) { cameraController.WorldWidth = _worldGenerator.WorldWidth; } }
private void OnStartButtonPressed(GameDifficultyMode difficultyMode) { _difficultyMode = difficultyMode; _startButtonPressed = true; _worldController.Initialize(_cameraController, _difficultyMode); _globalAudioManager.PlayAudioUIConfirmation(); }
private WorldGenerator GetWorldGenerator(GameDifficultyMode difficultyMode) { WorldGenerator worldGenerator = null; switch (difficultyMode) { case GameDifficultyMode.Easy: worldGenerator = _worldGeneratorEasy; break; case GameDifficultyMode.Default: worldGenerator = _worldGeneratorDefault; break; case GameDifficultyMode.Hard: worldGenerator = _worldGeneratorHard; break; } Debug.Assert(worldGenerator != null, "Failed to get world generator"); return(worldGenerator); }
private void OnStartButtonPressed(GameDifficultyMode difficultyMode) { StartButtonPressed?.Invoke(difficultyMode); }
public bool CheckForHighScore(GameDifficultyMode difficultyMode) { return(CurrentScore > GetHighScore(difficultyMode)); }
public void SetHighScore(int newHighScore, GameDifficultyMode difficultyMode) { PlayerPrefs.SetInt("HighScore" + difficultyMode.ToString(), newHighScore); }
public int GetHighScore(GameDifficultyMode difficultyMode) { return(PlayerPrefs.GetInt("HighScore" + difficultyMode.ToString())); }