Ejemplo n.º 1
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        public void Update(GameTime gameTime)
        {
            // For Mobile devices, this logic will close the Game when the Back button is pressed
            // Exit() is obsolete on iOS
                        #if !__IOS__
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                //Exit();
            }
                        #endif

            // Makes gesture inputs available to multiple consumers
            GestureManager.populate();

            foreach (GestureSample gesture in GestureManager.Gestures)
            {
                if (gesture.GestureType == GestureType.DoubleTap)
                {
                    try {
                        frameController.activate(frameHand);
                        Console.WriteLine("OHAI!");
                    }
                    catch (FrameController.InvalidFrameException) {
                        frameController.stow(frameHand);
                        Console.WriteLine("KTHXBAI!");
                    }
                }
            }

            frameController.arrange();
            frameHand.update(gameTime);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Allows the game to run logic such as updating the world,
 /// checking for collisions, gathering input, and playing audio.
 /// </summary>
 /// <param name="gameTime">Provides a snapshot of timing values.</param>
 public void Update(GameTime gameTime)
 {
     try {
         if ((ClientDataStore.Instance.CardRequested || frameBid.IsActive) && !playerIndicator.IsActive)
         {
             frameController.activate(playerIndicator);
         }
         else if (!(ClientDataStore.Instance.CardRequested || frameBid.IsActive) && playerIndicator.IsActive)
         {
             frameController.stow(playerIndicator);
         }
         frameController.arrange();
         frameHand.update(gameTime);
         frameTable.update(gameTime);
         frameBid.update(gameTime);
         frameScoreboard.update(gameTime);
         playerIndicator.update(gameTime);
         frameEndgame.update(gameTime);
     } catch (InvalidOperationException) {
         Console.WriteLine("CONCURRENT ACCESS WHILE UPDATING");
         Update(gameTime);
         return;
     }
 }