示例#1
0
        protected override void Initialize()
        {
            _keyboard.OnPress(Keys.Space, () =>
            {
                if (_scene != null)
                {
                    _sceneDescriptors.Next();
                }
                loadScene();
            });

            _keyboard.OnPress(Keys.Left, () =>
            {
                if (_scene != null)
                {
                    _sceneDescriptors.Prev();
                }
                loadScene();
            });

            _keyboard.OnPress(Keys.Right, () =>
            {
                if (_scene != null)
                {
                    _sceneDescriptors.Next();
                }
                loadScene();
            });
            base.Initialize();
        }
示例#2
0
 public static void Update(GameTime gameTime)
 {
     if (_transitioning)
     {
         Animator.Update(gameTime);
         if (Animator.State != AnimatorState.Finished)
         {
             return;
         }
         TransitionPairs.Next();
         Animator.ColorSetPair = TransitionPairs.GetCurrent();
         Animator.Reset();
         _transitioning = false;
     }
     else
     {
         WaitingTimer.Update(gameTime);
         if (!WaitingTimer.Finished)
         {
             return;
         }
         WaitingTimer.Reset();
         _transitioning = true;
     }
 }
        public static Color NextPrismColor()
        {
            _transitionProgress += 0.125f;
            if (_transitionProgress >= 1)
            {
                _transitionProgress = 0f;
                ColorPairs.Next();
            }
            var pair = ColorPairs.GetCurrent();

            return(Color.Lerp(pair.Item1, pair.Item2, _transitionProgress));
        }