Ejemplo n.º 1
0
        public PlayerHUD(Player _player)
        {
            player = _player;

            confirmedTimer = CONFIRMED_TIME;

            esxolusShipPositions = new Vector2[]
            {
                new Vector2(319, 8),
                new Vector2(292, 8),
                new Vector2(264, 8),
                new Vector2(236, 8),
                new Vector2(208, 8)
            };

            halkShipPositions = new Vector2[]
            {
                new Vector2(469, 8),
                new Vector2(496, 8),
                new Vector2(523, 8),
                new Vector2(550, 8),
                new Vector2(576, 8)
            };

            numbers = new Vector2[]
            {
                new Vector2(370, 27),
                new Vector2(377, 27),
                new Vector2(387, 27), // :
                new Vector2(391, 27),
                new Vector2(398, 27),
                new Vector2(408, 27), // :
                new Vector2(412, 27),
                new Vector2(420, 27)
            };

            for (int i = 0; i < numbers.Length; i++)
            {
                numbers[i].X *= AutoTexture2D.WidthConversion;
                numbers[i].Y *= AutoTexture2D.HeightConversion;
            }

            secondaryNumbers = new Vector2[]
            {
                new Vector2(27, 415),
                new Vector2(35, 415),
                new Vector2(43, 415)
            };
        }
Ejemplo n.º 2
0
        public Vector3 playerInit(Vector3 _offset, Player _player)
        {
            if (_player.PlayerShip != null)
            {
                Position = _player.PlayerShip.Position + _offset;
                Target = _player.PlayerShip.Position;
                playerShip = _player.PlayerShip;
            }
            else
            {
                Position = Vector3.Zero + _offset;
                Target = Vector3.Zero;
                playerShip = null;
            }

            return Position;
        }
Ejemplo n.º 3
0
 public static bool isCombinedPausePressed(Player.ControllerIndex index)
 {
     bool pressed = false;
     if (index != Player.ControllerIndex.Keyboard)
     {
         pressed = (isStartPressed((PlayerIndex)index));
     }
     else
     {
         pressed = (isKeyEscPressed());
     }
     return pressed;
 }
Ejemplo n.º 4
0
 public static bool isCombinedLeftStickUp(Player.ControllerIndex index)
 {
     bool up = false;
     if (index != Player.ControllerIndex.Keyboard)
     {
         up = (isLeftStickUp((PlayerIndex)index));
     }
     else
     {
         up = (isKeyOUp());
     }
     return up;
 }
Ejemplo n.º 5
0
 public static bool isCombinedLeftStickDown(Player.ControllerIndex index)
 {
     bool down = false;
     if (index != Player.ControllerIndex.Keyboard)
     {
         down = (isLeftStickDown((PlayerIndex)index));
     }
     else
     {
         down = (isKeyODown());
     }
     return down;
 }
Ejemplo n.º 6
0
 public static bool isCombinedLeftRightStickPressed(Player.ControllerIndex index)
 {
     bool pressed = false;
     if (index != Player.ControllerIndex.Keyboard)
     {
         pressed = (isRightStickXVectorZeroedOut((PlayerIndex)index) && rightStickXVector((PlayerIndex)index) < 0);
     }
     else
     {
         pressed = (isKeyLeftPressed()/* || isMouseLeft()*/);
     }
     return pressed;
 }
Ejemplo n.º 7
0
 public static bool isCombinedLeftLeftStickPressed(Player.ControllerIndex index)
 {
     bool pressed = false;
     if (index != Player.ControllerIndex.Keyboard)
     {
         pressed = (isLeftStickXVectorZeroedOut((PlayerIndex)index) && leftStickXVector((PlayerIndex)index) < 0);
     }
     else
     {
         pressed = (isKeyAPressed());
     }
     return pressed;
 }
Ejemplo n.º 8
0
        public static bool isCombinedLeftCombinedStickPressed(Player.ControllerIndex index)
        {
            bool pressed = false;
            if (isCombinedLeftLeftStickPressed(index) || isCombinedLeftRightStickPressed(index))
            {
                pressed = true;
            }
            else
            {

            }
            return pressed;
        }
Ejemplo n.º 9
0
 public static bool isCombinedConfirmDown(Player.ControllerIndex index)
 {
     bool down = false;
     if (index != Player.ControllerIndex.Keyboard)
     {
         down = (isADown((PlayerIndex)index));
     }
     else
     {
         down = (isKeyEnterDown());
     }
     return down;
 }
Ejemplo n.º 10
0
 public static bool isCombinedBoostUp(Player.ControllerIndex index)
 {
     bool up = false;
     if (index != Player.ControllerIndex.Keyboard)
     {
         up = (isRTUp((PlayerIndex)index));
     }
     else
     {
         up = (isKeyCUp());
     }
     return up;
 }
Ejemplo n.º 11
0
 public static float RightStickYDegree(Player.ControllerIndex index)
 {
     float degree = 0;
     if (index != Player.ControllerIndex.Keyboard)
     {
         degree = GamePad.GetState((PlayerIndex)index).ThumbSticks.Right.Y;
     }
     else
     {
         if (isKeyDownDown() && !isKeyUpDown())
         {
             degree = -KEYBOARD_DEGREE;
         }
         else if (isKeyUpDown() && !isKeyDownDown())
         {
             degree = KEYBOARD_DEGREE;
         }
         else { }
     }
     return degree;
 }
Ejemplo n.º 12
0
 public static float RightStickXDegree(Player.ControllerIndex index)
 {
     float degree = 0;
     if (index != Player.ControllerIndex.Keyboard)
     {
         if (isLBDown((PlayerIndex)index) && !isRBDown((PlayerIndex)index))
         {
             degree = -KEYBOARD_DEGREE;
         }
         else if (isRBDown((PlayerIndex)index) && !isLBDown((PlayerIndex)index))
         {
             degree = KEYBOARD_DEGREE;
         }
         else
         {
             degree = GamePad.GetState((PlayerIndex)index).ThumbSticks.Right.X;
         }
     }
     else
     {
         if ((isKeyLeftDown() || isKeyQDown()) && !(isKeyRightDown() || isKeyEDown()))
         {
             degree = -KEYBOARD_DEGREE;
         }
         else if ((isKeyRightDown() || isKeyEDown()) && !(isKeyLeftDown() || isKeyQDown()))
         {
             degree = KEYBOARD_DEGREE;
         }
         else { }
     }
     return degree;
 }
Ejemplo n.º 13
0
 public static bool isCombinedUnconfirmUp(Player.ControllerIndex index)
 {
     bool up = false;
     if (index != Player.ControllerIndex.Keyboard)
     {
         up = (isBUp((PlayerIndex)index));
     }
     else
     {
         up = (isKeyBackspaceUp());
     }
     return up;
 }
Ejemplo n.º 14
0
 public static bool isCombinedUnconfirmDown(Player.ControllerIndex index)
 {
     bool down = false;
     if (index != Player.ControllerIndex.Keyboard)
     {
         down = (isBDown((PlayerIndex)index));
     }
     else
     {
         down = (isKeyBackspaceDown());
     }
     return down;
 }
Ejemplo n.º 15
0
 public static bool isCombinedToggleObjectivesUp(Player.ControllerIndex index)
 {
     bool up = false;
     if (index != Player.ControllerIndex.Keyboard)
     {
         up = (isYUp((PlayerIndex)index));
     }
     else
     {
         up = (isKeyOUp());
     }
     return up;
 }
Ejemplo n.º 16
0
 public static bool isCombinedDownRightStickUp(Player.ControllerIndex index)
 {
     bool up = false;
     if (index != Player.ControllerIndex.Keyboard)
     {
         up = (isRightStickYVectorZeroedOut((PlayerIndex)index));
     }
     else
     {
         up = (isKeyDownUp());
     }
     return up;
 }
Ejemplo n.º 17
0
        public static bool isCombinedLeftCombinedStickDown(Player.ControllerIndex index)
        {
            bool down = false;
            if (isCombinedLeftLeftStickDown(index) || isCombinedLeftRightStickDown(index))
            {
                down = true;
            }
            else
            {

            }
            return down;
        }
Ejemplo n.º 18
0
 public static bool isCombinedConfirmPressed(Player.ControllerIndex index)
 {
     bool pressed = false;
     if (index != Player.ControllerIndex.Keyboard)
     {
         pressed = (isAPressed((PlayerIndex)index));
     }
     else
     {
         pressed = (isKeyEnterPressed());
     }
     return pressed;
 }
Ejemplo n.º 19
0
        public static bool isCombinedLeftCombinedStickUp(Player.ControllerIndex index)
        {
            bool up = false;
            if (isCombinedLeftLeftStickUp(index) && isCombinedLeftRightStickUp(index))
            {
                up = true;
            }
            else
            {

            }
            return up;
        }
Ejemplo n.º 20
0
 public static bool isCombinedConfirmUp(Player.ControllerIndex index)
 {
     bool up = false;
     if (index != Player.ControllerIndex.Keyboard)
     {
         up = (isAUp((PlayerIndex)index));
     }
     else
     {
         up = (isKeyEnterUp());
     }
     return up;
 }
Ejemplo n.º 21
0
 public static bool isCombinedLeftRightStickDown(Player.ControllerIndex index)
 {
     bool down = false;
     if (index != Player.ControllerIndex.Keyboard)
     {
         down = (rightStickXVector((PlayerIndex)index) < 0);
     }
     else
     {
         down = (isKeyLeftDown()/* || isMouseLeft()*/);
     }
     return down;
 }
Ejemplo n.º 22
0
 public static bool isCombinedDownLeftStickDown(Player.ControllerIndex index)
 {
     bool down = false;
     if (index != Player.ControllerIndex.Keyboard)
     {
         down = (leftStickYVector((PlayerIndex)index) < 0);
     }
     else
     {
         down = (isKeySDown()/* || isMouseDown()*/);
     }
     return down;
 }
Ejemplo n.º 23
0
 public static bool isCombinedLeftRightStickUp(Player.ControllerIndex index)
 {
     bool up = false;
     if (index != Player.ControllerIndex.Keyboard)
     {
         up = (isRightStickXVectorZeroedOut((PlayerIndex)index));
     }
     else
     {
         up = (isKeyLeftUp()/* && !isMouseLeft()*/);
     }
     return up;
 }
Ejemplo n.º 24
0
 public static bool isCombinedDownLeftStickPressed(Player.ControllerIndex index)
 {
     bool pressed = false;
     if (index != Player.ControllerIndex.Keyboard)
     {
         pressed = (isLeftStickYVectorZeroedOut((PlayerIndex)index) && leftStickYVector((PlayerIndex)index) < 0);
     }
     else
     {
         pressed = (isKeySPressed()/* || isMouseDown()*/);
     }
     return pressed;
 }
Ejemplo n.º 25
0
 public static bool isCombinedLeftStickPressed(Player.ControllerIndex index)
 {
     bool pressed = false;
     if (index != Player.ControllerIndex.Keyboard)
     {
         pressed = (isLeftStickPressed((PlayerIndex)index));
     }
     else
     {
         pressed = (isKeyOPressed());
     }
     return pressed;
 }
Ejemplo n.º 26
0
 public static bool isCombinedDownLeftStickUp(Player.ControllerIndex index)
 {
     bool up = false;
     if (index != Player.ControllerIndex.Keyboard)
     {
         up = (isLeftStickYVectorZeroedOut((PlayerIndex)index));
     }
     else
     {
         up = (isKeySUp()/* && !isMouseDown()*/);
     }
     return up;
 }
Ejemplo n.º 27
0
 public static bool isCombinedPauseDown(Player.ControllerIndex index)
 {
     bool down = false;
     if (index != Player.ControllerIndex.Keyboard)
     {
         down = (isStartDown((PlayerIndex)index));
     }
     else
     {
         down = (isKeyEscDown());
     }
     return down;
 }
Ejemplo n.º 28
0
 public static bool isCombinedDownRightStickDown(Player.ControllerIndex index)
 {
     bool down = false;
     if (index != Player.ControllerIndex.Keyboard)
     {
         down = (rightStickYVector((PlayerIndex)index) < 0);
     }
     else
     {
         down = (isKeyDownDown());
     }
     return down;
 }
Ejemplo n.º 29
0
 public static bool isCombinedPauseUp(Player.ControllerIndex index)
 {
     bool up = false;
     if (index != Player.ControllerIndex.Keyboard)
     {
         up = (isStartUp((PlayerIndex)index));
     }
     else
     {
         up = (isKeyEscUp());
     }
     return up;
 }
Ejemplo n.º 30
0
 public static bool isCombinedDownRightStickPressed(Player.ControllerIndex index)
 {
     bool pressed = false;
     if (index != Player.ControllerIndex.Keyboard)
     {
         pressed = (isRightStickYVectorZeroedOut((PlayerIndex)index) && rightStickYVector((PlayerIndex)index) < 0);
     }
     else
     {
         pressed = (isKeyDownPressed());
     }
     return pressed;
 }