Пример #1
0
        public override void Update()
        {
            _delayAlarm.Update();

            if (_delayAlarm.Running)
            {
                return;
            }

            if (_alarm.Update())
            {
                _fadeDirection *= -1;
                if (_fadeDirection == 1)
                {
                    DestroyEntity();
                }
                else
                {
                    if (_nextLevel)
                    {
                        MapController.BuildNextMap();
                    }
                    else
                    {
                        MapController.RebuildCurrentMap();
                    }
                }
            }


            _blackscreenAlpha = _alarm.Counter / _fadeTime;

            if (_fadeDirection == 1)
            {
                _blackscreenAlpha = 1 - _blackscreenAlpha;
            }
        }