Exemplo n.º 1
0
 /// <summary>
 /// IsMenuMouseSelect
 /// </summary>
 private bool IsMenuMouseSelect(InputState input, out int selected)
 {
     Vector2 Coord;
     selected = 0;
     if (input.IsNewMouseLeftClick(out Coord))
     {
         foreach (MenuEntry M in MenuEntries)
         {
             if (M.IsContained(Coord, this.ScreenManager.Font))
             {
                 return true;
             }
             selected++;
         }
     }
     return false;
 }
Exemplo n.º 2
0
        public void HandleInput(InputState input)
        {
            if (input.IsNewMouseLeftClick(out MouseCord) || input.IsNewMouseRightClick(out MouseCord) || input.IsMouseLeftClickHold())
            {
                // Myszka na interfejsie
                if (input.CurrentMouseState.X < GameInterface.Width)
                {
                    GameInterface.HandleInput(input);
                }
                // Myszka w grze
                else
                {
                    if (input.IsNewMouseRightClick(out MouseCord))
                    {
                        foreach (Fighter f in Fighters)
                        {
                            if ((!f.IsAlive && f.isDying) || f.IsAlive)
                                f.Move(screenManager.Settings.Resolution, GameMap, Fighters, Enemies, input);
                        }
                    }
                    if (input.IsMouseLeftClickHold())
                    {
                        foreach (Fighter f in Fighters)
                        {
                            if ((!f.IsAlive && f.isDying) || f.IsAlive)
                                f.Shoot(screenManager, input, Weapon.Gun, screenManager.GameTime, Missiles);
                        }
                    }
                }

            }

            if (input.IsNewKeyPress(Keys.Z))
            {
                if (Fighters.Count>0)
                Fighters[0].Die(Fighters);
                if (Fighters.Count>2)
                Fighters[2].Die(Fighters);
            }
        }