Pan-tastic Wizard Adventures

The Video

The Idea

For Pan-tastic Wizard Adventures, it was all about a little wizard and his frying pan. The core loop of the game should be combining ingredients that you can find throughout the world and from slaying enemies. These ingredients can be put into one of three slots. The first slot determines the element type of the shot, the second one controls the trajectory of the spell, and the third slot influences how often the spell is cast in succession. The game itself is just a high-fidelity prototype with enemies you can fight and one "stronger" boss. This is a project that I will definitely pick up again in the future and refine it a bit. Download Link

The Code

I worked on the inventory system and the level prototype. The inventory itself is just a class that has a list of items and that can add and remove items from this list.

public class Inventory
{
    public event EventHandler OnItemListChanged;
    private List<Item> inventoryList = new List<Item>();  

    public void AddItem(Item item)
    { 
        if(inventory.ContainsItem(item)):
        inventory.increaseItemCount(item);
        else:
        inventoryList.Append(item);
        OnItemListChanged?.Invoke();
    }

    public void RemoveItem(Item item) 
    {
        item = inventory.GetItem(item)
        item.amout -= 1 ;

        if(item.amout <= 0)
        inventoryList.RemoveItem(item)
        OnItemListChanged?.Invoke(this, EventArgs.Empty);
    }

    public List<Item> GetItemList()
    {
        return m_itemList;
    }
}

To tie this all to the UI, I made a separate class that handles changes in the inventory, which just creates the view seen in the image below.

inventory
The inventory is basically this book where all ingredients that the player has are listed, for each new ingredient, a slot is created to a maximum of 4 slots in each row. The black circle shows which item is currently selected. If one item is used up, it is removed from the list.