예제 #1
0
    protected override void Update(GameTime gameTime)
    {
        if (IsActive && GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
        {
            Exit();
        }

        if (IsActive && QuestionManager.Instance().isMovingQuestionBoardElement)
        {
            QuestionManager.Instance().ReceiveMouseInput(Mouse.GetState().Position);
        }

        if (IsActive && QuickTimeMovement.Instance().isActive)
        {
            QuickTimeMovement.Instance().Update();
        }

        if (IsActive && !pressHandled && Mouse.GetState().LeftButton == ButtonState.Pressed)
        {
            Board.Instance().OnClick(Mouse.GetState().Position);

            // do after, no time to explain
            if (QuickTimeMovement.Instance().isActive)
            {
                QuickTimeMovement.Instance().OnClick();
            }
            pressHandled = true;
        }
        else if (pressHandled && Mouse.GetState().LeftButton == ButtonState.Released)
        {
            pressHandled = false;
        }

        base.Update(gameTime);
    }
예제 #2
0
 public override void OnClick()
 {
     if (!hasWon)
     {
         QuickTimeMovement.Instance().Activate(this);
     }
 }