Пример #1
0
        protected override void Update(GameTime gameTime)
        {
            TesteMapa.update(gameTime);
            Input.Update();
            MIRA.update();
            MouseState mState = Mouse.GetState();

            Camera.Focus = MIRA;
            mousevector  = new Vector2(mState.X, mState.Y);
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed || Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                Exit();
            }

            if (Input.IsPressed(Keys.K))
            {
                //CameraFocusAux++;
                //if (CameraFocusAux > CharactersHandler.Players.Count-1) CameraFocusAux = 0;
                //Camera.Focus = CharactersHandler.Players[CameraFocusAux];
                CharactersHandler.ChangeActive();
            }
            CharactersHandler.updatePlayers(gameTime);
            //Player1.Update(gameTime);
            //Player2.Update(gameTime);
            base.Update(gameTime);
        }
Пример #2
0
 protected override void Update(GameTime gameTime)
 {
     Input.Update();
     if (gameState == GameState.Menu)
     {
         MenusHandler.Update(gameTime, this);
     }
     else
     {
         roundTime -= (float)gameTime.ElapsedGameTime.TotalSeconds;
         TesteMapa.update(gameTime);
         MouseState mState = Mouse.GetState();
         mousevector = new Vector2(mState.X, mState.Y);
         if (Keyboard.GetState().IsKeyDown(Keys.Escape))
         {
             gameState = GameState.Paused;
         }
         if (Input.IsPressed(Keys.K) && Player1.isJumping() == false && Player2.isJumping() == false)
         {
             CharactersHandler.ChangeActive();
         }
         if (roundTime <= 0)
         {
             CharactersHandler.ChangeActive();
             roundTime = 20;
         }
         CharactersHandler.updatePlayers(gameTime);
     }
     base.Update(gameTime);
 }