Example #1
0
        public void Update(float deltaTime)
        {
            foreach (MapTile tile in _tiles)
            {
                tile.Update(deltaTime);
            }
            if (_shiftedOutTile != null)
            {
                _shiftedOutTile.Update(deltaTime);
            }

            //process queue
            if (_shiftQueue.Count > 0)
            {
                if (!_isShifting)
                {
                    MapShift temp = _shiftQueue.First.Value;
                    _shiftQueue.RemoveFirst();
                    if (SoundEffectManager.GetSoundState("shift") == SoundState.Stopped)
                    {
                        SoundEffectManager.PlaySound("shift");
                    }
                    shiftTiles(temp.Index, temp.Direction, temp.TileDoors);
                }
            }
            else if (!_isShifting)
            {
                if (SoundEffectManager.GetSoundState("shift") == SoundState.Playing)
                {
                    SoundEffectManager.StopSound("shift");
                }
            }

            NervePulseTimeCount += deltaTime * 1000;
        }
Example #2
0
 internal void GoToFullHealth()
 {
     _currentHealth = _maxHealth;
     if (SoundEffectManager.GetSoundState("heartbeat") == SoundState.Playing)
     {
         SoundEffectManager.StopSound("heartbeat");
     }
 }
Example #3
0
        public override void ApplyDamage(float amount)
        {
            SoundEffectManager.PlayEffect("impact", 0.1f);
            PainStaticMaker.AddDamage(amount);

            //heatbeat
            if ((_currentHealth / _maxHealth) < 0.3 && SoundEffectManager.GetSoundState("heartbeat") != SoundState.Playing)
            {
                SoundEffectManager.PlaySound("heartbeat");
            }
            base.ApplyDamage(amount);
        }