Ejemplo n.º 1
0
        } // Buys misc stuff from shop

        public void BuyItemFromShop(ItemsToUpgrade item, int price, int newLevel)
        {
            if (coins >= price)
            {
                UpgradeItem(newLevel, item);
                coins -= price;
            }
            else
            {
                MessageBox.Show("You dont have enough money to buy this item :(");
            }
        } // Buys armor and sword from shop
Ejemplo n.º 2
0
        public void UpgradeItem(int newItemLevel, ItemsToUpgrade itemName)
        {
            switch (itemName)
            {
            case ItemsToUpgrade.Armor:
                if (newItemLevel > armorItem)
                {
                    armorItem = newItemLevel;
                }
                break;

            case ItemsToUpgrade.Sword:
                if (newItemLevel > swordItem)
                {
                    swordItem = newItemLevel;
                }
                break;
            }
        } // Tests to pickup an item, if it is better than one you have