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;
        }
    }
Beispiel #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();
 }
Beispiel #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();
 }
Beispiel #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);
     }
 }
Beispiel #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);
     }
 }
Beispiel #7
0
 public void SetDiraction(MOVING_DIRECTION diraction)
 {
     movingDiraction = diraction;
 }