コード例 #1
0
 /**
  * Reset all params
  */
 public static void Reset()
 {
     game_difficulty = GAME_DIFFICULTY.EASY;
     nb_attempts     = DEFAULT_NB_ATTEMPTS;
     nb_balls        = DEFAULT_NB_BALLS;
     Debug.Log("All params have been reset.");
 }
コード例 #2
0
    /**
     * Set the difficulty of the game
     * And the other params according to it
     */
    public static void SetGameDifficulty(GAME_DIFFICULTY difficulty)
    {
        game_difficulty = difficulty;

        switch (game_difficulty)
        {
        case GAME_DIFFICULTY.EASY:
            nb_attempts = MAX_NB_ATTEMPTS;
            nb_balls    = MIN_NB_BALLS;

            return;

        case GAME_DIFFICULTY.NORMAL:
            nb_attempts = MID_NB_ATTEMPTS;
            nb_balls    = MID_NB_BALLS;

            return;

        case GAME_DIFFICULTY.HARD:
            nb_attempts = MIN_NB_ATTEMPTS;
            nb_balls    = MAX_NB_BALLS;

            return;
        }
    }
コード例 #3
0
    public void UpdateFields(float time, GAME_DIFFICULTY difficulty, bool isGamePaused, bool isPlayerDead, MOVING_DIRECTION movingDiraction)
    {
        _movingDiraction = movingDiraction;
        _difficulty      = difficulty;
        if (!_spawnTimeInitialized)
        {
            switch (difficulty)
            {
            case GAME_DIFFICULTY.NORMAL:
            {
                _lightBurstSpawnTime = time + 15f;
            }
            break;

            case GAME_DIFFICULTY.HARD:
            {
                _lightBurstSpawnTime = time + 8f;
            }
            break;
            }
            _spawnTimeInitialized = true;
        }
        if (isPlayerDead)
        {
            GameManager.Instanse.RemoveObserver(this);
        }
        if (time > _lightBurstSpawnTime)
        {
            NotifyObservers();
            _spawnTimeInitialized = false;
        }
    }
コード例 #4
0
 public void UpdateFields(float time, GAME_DIFFICULTY difficulty, bool isGamePaused, bool isPlayerDead, MOVING_DIRECTION movingDiraction)
 {
     if (isPlayerDead)
     {
         GameManager.Instanse.RemoveObserver(this);
         Application.LoadLevel(2);
     }
 }
コード例 #5
0
 public void UpdateFields(float time, GAME_DIFFICULTY difficulty, bool isGamePaused, bool isPlayerDead, MOVING_DIRECTION movingDiraction)
 {
     _isGamePaused = isGamePaused;
     _isPlayerDead = isPlayerDead;
     _firstUpdate  = true;;
     if (_isPlayerDead && !_firstUpdate)
     {
         _gameTime = 0;
         _gameManager.RemoveObserver(this);
     }
 }
コード例 #6
0
 public void UpdateFields(float time, GAME_DIFFICULTY difficulty, bool isGamePaused, bool isPlayerDead, MOVING_DIRECTION movingDiraction)
 {
     _currentTime  = time;
     _isGamePaused = isGamePaused;
     _isPlayerDead = isPlayerDead;
     _difiiculty   = difficulty;
     if (_isPlayerDead)
     {
         GameManager.Instanse.RemoveObserver(this);
     }
     ChangeSpeedByDifficulty();
 }
コード例 #7
0
 public void UpdateFields(float time, GAME_DIFFICULTY difficulty, bool isGamePaused, bool isPlayerDead, MOVING_DIRECTION movingDiraction)
 {
     _gameTime     = time;
     _isGamePaused = isGamePaused;
     _isPlayerDead = isPlayerDead;
     if (!_isGamePaused)
     {
         CalculateScore(time);
     }
     if (_isPlayerDead)
     {
         GameManager.Instanse.RemoveObserver(this);
         GameManager.Instanse.Score = (int)_score;
     }
     DisplayScore();
 }
コード例 #8
0
 public void SetDifficulty(GAME_DIFFICULTY difficulty)
 {
     this._difficulty = difficulty;
     _gameState       = G_MANAGER_STATE.PLAY;
 }
コード例 #9
0
 /**
  * Setter for custom settings
  */
 public static void LoadParams(int nbAttempts, int nbBalls)
 {
     game_difficulty = GAME_DIFFICULTY.CUSTOM;
     nb_attempts     = Mathf.Max(nbAttempts, 1);
     nb_balls        = nbBalls > MAX_NB_BALLS ? MAX_NB_BALLS : Mathf.Max(nbBalls, 1);
 }
コード例 #10
0
 public void ChangeGameDifficulty(int level)
 {
     GameDifficulty = (GAME_DIFFICULTY)level;
 }
コード例 #11
0
ファイル: TestButton.cs プロジェクト: IIIycTpbIu-hub/StrapRun
 public void SetDifficlultyToEasy()
 {
     _difficulty = GAME_DIFFICULTY.EASY;
 }
コード例 #12
0
ファイル: TestButton.cs プロジェクト: IIIycTpbIu-hub/StrapRun
 public void SetDifficlultyToHard()
 {
     _difficulty = GAME_DIFFICULTY.HARD;
 }
コード例 #13
0
ファイル: TestButton.cs プロジェクト: IIIycTpbIu-hub/StrapRun
 public void SetDifficlultyToNormal()
 {
     _difficulty = GAME_DIFFICULTY.NORMAL;
 }