Example #1
0
        public void Update(GameEngine gameEngine, GameTime gameTime)
        {
            if (IsTransitioning)
            {
                return;
            }
            EventScript.Update(gameTime);

            if (EventScript.IsFinished())
            {
                gameEngine.Pop(true, true);
                IsTransitioning = true;
            }
        }
        public void Update(GameEngine gameEngine, GameTime gameTime)
        {
            if (IsTransitioning)
            {
                return;
            }

            MouseState = Mouse.GetState();
            if (PrevMouseState.LeftButton == ButtonState.Pressed && MouseState.LeftButton == ButtonState.Released)
            {
                MouseClicked(gameTime, MouseState.X, MouseState.Y);
            }

            switch (GState)
            {
            case InterviewState.Contradiction:
                gameEngine.Push(new NotebookManager(true, ref IdContradict), true, true);
                IsTransitioning = true;
                break;

            case InterviewState.Exiting:
                gameEngine.Pop(true, true);
                IsTransitioning = true;
                break;

            case InterviewState.TopicChoice:
                foreach (Button TopicButton in TopicButtons)
                {
                    TopicButton.Update();
                }
                break;

            case InterviewState.PlayText:
                ContradictButton?.Update();
                EventScript.Update(gameTime);
                if (EventScript.IsFinished())
                {
                    GState      = (!IsContradicted) ? InterviewState.TopicChoice : InterviewState.Exiting;
                    EventScript = null;
                    MainCharacter.TestimonyIds.Add(TestimonyId);
                }
                break;

            default:
                break;
            }
            PrevMouseState = MouseState;
        }