/** * 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."); }
/** * 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; } }
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; } }
public void UpdateFields(float time, GAME_DIFFICULTY difficulty, bool isGamePaused, bool isPlayerDead, MOVING_DIRECTION movingDiraction) { if (isPlayerDead) { GameManager.Instanse.RemoveObserver(this); Application.LoadLevel(2); } }
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); } }
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(); }
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(); }
public void SetDifficulty(GAME_DIFFICULTY difficulty) { this._difficulty = difficulty; _gameState = G_MANAGER_STATE.PLAY; }
/** * 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); }
public void ChangeGameDifficulty(int level) { GameDifficulty = (GAME_DIFFICULTY)level; }
public void SetDifficlultyToEasy() { _difficulty = GAME_DIFFICULTY.EASY; }
public void SetDifficlultyToHard() { _difficulty = GAME_DIFFICULTY.HARD; }
public void SetDifficlultyToNormal() { _difficulty = GAME_DIFFICULTY.NORMAL; }