Exemplo n.º 1
0
        public override void Update(GameTime gameTime)
        {
            base.Update(gameTime);

            if (player1.GetComponent <GamePadInput>().Pressed(Buttons.Back) ||
                player1.GetComponent <KeyboardInput>().Pressed(Keys.Escape))
            {
                GameStateManager.RequestExit = true;
            }

            if (player1.GetComponent <GamePadInput>().Pressed(Buttons.LeftTrigger) ||
                player1.GetComponent <GamePadInput>().Pressed(Buttons.RightTrigger))
            {
                particles.Create(TextureManager.Laser, player1.GetComponent <Kinematics>().Position, 60, 300, ParticleType.None, 0.0f);
                grid.ApplyImplosiveForce(750, player1.GetComponent <Kinematics>().Position, 50);
            }

            if (player2.GetComponent <GamePadInput>().Pressed(Buttons.LeftTrigger) ||
                player2.GetComponent <GamePadInput>().Pressed(Buttons.RightTrigger))
            {
                particles.Create(TextureManager.Laser, player2.GetComponent <Kinematics>().Position, 60, 300, ParticleType.None, 0.0f);
                grid.ApplyExplosiveForce(750, player2.GetComponent <Kinematics>().Position, 50);
            }

            camera1.Position = player1.GetComponent <Kinematics>().Position;
            camera2.Position = player2.GetComponent <Kinematics>().Position;
        }