Esempio n. 1
0
        public override void Update(Player player, Computer p2, GameTime gameTime)
        {
            MouseState newMouse = Mouse.GetState();

            if (oldMouse.LeftButton == ButtonState.Released && newMouse.LeftButton == ButtonState.Pressed &&
                isSelected && swordsman_rect.Contains(newMouse.Position))
            {
                Swordsman temp = new Swordsman(HUD.swordsman, new Vector2(330, new System.Random().Next() % 380));
                player.units.Add(temp);
                player.soldiers.Add(temp);
            }

            oldMouse = newMouse;
        }