} // 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
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