예제 #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;
        }
예제 #2
0
파일: Player.cs 프로젝트: pR0Ps/ChaoticMind
        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);
        }