Ejemplo n.º 1
0
        public void ShootWeapons(Player player, Vector2 realPos)
        {
            ShootCalc.LineAim(realPos, player, player.WeaponOrigin,
                              player.CurrentWeaponObject.GunBarrel, player.CurrentWeaponObject.Reach);

            if (player.WeaponsAvailable == true && player.ControlsActive == true &&
                player.Carry == null && player.InVehicle == false)
            {
                if (MouseInput.MouseStateNew.LeftButton == ButtonState.Pressed)
                {
                    if (CompareF.WeaponRayObstruction(player.Boundary,
                                                      ShootCalc.RayBarrel, Game1.PlayerInstance).Object == null)
                    {
                        player.CurrentWeaponObject.Fire(ShootCalc.RaySegment,
                                                        ShootCalc.RayDestination);
                    }
                    else
                    {
                        player.CurrentWeaponObject.SetOff();
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public void LineAim(Vector2 realPos, Player player)
 {
     ShootCalc.LineAim(realPos, player, player.WeaponOrigin, player.CurrentWeaponObject.GunBarrel, player.CurrentWeaponObject.Reach);
 }