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;
        }
    }
Exemple #2
0
 // Use this for initialization
 void Start()
 {
     movingDiraction = MOVING_DIRECTION.LEFT;
     RegisterToSubject();
     SetDiractionPoints();
     if (movingObjectType == OBJECT_TYPE.LIGHTSHOT)
     {
         _speed = 30f;
     }
 }
 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();
 }
Exemple #4
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();
 }
Exemple #5
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);
     }
 }
Exemple #6
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);
     }
 }
Exemple #7
0
 public void SetDiraction(MOVING_DIRECTION diraction)
 {
     movingDiraction = diraction;
 }