Beispiel #1
0
 private void updateSelect(GameTime time)
 {
     lastState = state;
     state     = Mouse.GetState().LeftButton;
     stagnant  = true;
     playerManager.setManaDrainRate(5);
     if (lastState == ButtonState.Pressed && state == ButtonState.Released)
     {
         foreach (GameObject obj in level.getObjectsAndKeys())
         {
             if (obj.isLiftable())
             {
                 if (obj.getBounds().Contains(new Point(Mouse.GetState().X, Mouse.GetState().Y)))
                 {
                     obj.setSelected(true);
                     selectedObject = obj;
                     gameState      = GameState.TelekinesisMovement;
                     level.setMode(2);
                 }
             }
         }
     }
     else if (lastKeyState.IsKeyDown(Keys.Q) && currentKeyState.IsKeyUp(Keys.Q))
     {
         gameState = GameState.Normal;
         level.setMode(0);
     }
 }