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(); }
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)); }