Beispiel #1
0
        public void Draw(SpriteBatch spriteBatch)
        {
            if (running && !isFininshed)
            {
                currentTransition.Draw(spriteBatch);

                if (currentTransition.IsFininshed)
                {
                    currentTransition = GetNextTransition();
                }
            }
        }
Beispiel #2
0
        public void Update(GameTime gameTime)
        {
            if (running && !isFininshed)
            {
                currentTransition.Update(gameTime);

                if (currentTransition.IsFininshed)
                {
                    currentTransition = GetNextTransition();
                }
            }
        }
Beispiel #3
0
        public void Start()
        {
            if (running)
            {
                return;
            }

            foreach (StateTransition transition in transitions)
            {
                transition.NextGameState    = nextGameState;
                transition.CurrentGameState = currentGameState;
            }

            running = true;

            currentTransition = transitions[0];

            if (!PlayingLastTransition())
            {
                currentTransition.NextTransition = transitions[1];
            }

            currentTransition.Start();
        }
Beispiel #4
0
 public StateTransitionEventArgs(StateTransition sender)
 {
     this.sender = sender;
 }
Beispiel #5
0
 public TransitionPlayerEventArgs(StateTransition finishedTransition)
     : base()
 {
     this.finishedTransition = finishedTransition;
 }