Пример #1
0
 public void Initialize(CameraController cameraController, GameDifficultyMode difficultyMode)
 {
     _worldGenerator = GetWorldGenerator(difficultyMode);
     if (_worldGenerator != null)
     {
         cameraController.WorldWidth = _worldGenerator.WorldWidth;
     }
 }
Пример #2
0
    private void OnStartButtonPressed(GameDifficultyMode difficultyMode)
    {
        _difficultyMode     = difficultyMode;
        _startButtonPressed = true;

        _worldController.Initialize(_cameraController, _difficultyMode);

        _globalAudioManager.PlayAudioUIConfirmation();
    }
Пример #3
0
    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);
    }
Пример #4
0
 private void OnStartButtonPressed(GameDifficultyMode difficultyMode)
 {
     StartButtonPressed?.Invoke(difficultyMode);
 }
Пример #5
0
 public bool CheckForHighScore(GameDifficultyMode difficultyMode)
 {
     return(CurrentScore > GetHighScore(difficultyMode));
 }
Пример #6
0
 public void SetHighScore(int newHighScore, GameDifficultyMode difficultyMode)
 {
     PlayerPrefs.SetInt("HighScore" + difficultyMode.ToString(), newHighScore);
 }
Пример #7
0
 public int GetHighScore(GameDifficultyMode difficultyMode)
 {
     return(PlayerPrefs.GetInt("HighScore" + difficultyMode.ToString()));
 }