Agri Cultura is a 2D farming simulation game developed in Unity as a solo project. In this project, I focused on creating a polished UI, which features an inventory UI with transition animations, a hot bar system that allow the user to choose an item to use by using the mouse scroll wheel, a vendor UI which the user can purchase items from, as well as an item system developed using polymorphism.
The inventory system parses a list of items, and then display it in the UI, where the player can manage the inventory. This UI supports splitting, stacking and moving items between different inventory slots.
In order to use an item, the player have to place items into the hot bar from the inventory. As items are polymorphic, each item can have their own effects when used. For example, the “Hoe” is derived from the Item class and the Item class has a “virtual” function “Use”. When “Use” is called by the hot bar, the hoe will call up the TileSelector class to obtain details on the tile the player has clicked on, if it’s a valid tile for tilling, the tile will be tilled, if it’s invalid, then the hoe would do nothing. On the other hand, seeds is also derived from Item class. But the seeds does not till the ground when it's "Use' function is called. Instead, it checks if played had clicked on a tilled ground tile, if they did, seeds will be planted on it.
Dialogues stored in a json file as a dictionary. Each set of conversations have their own key strings. Depending on the language settings of the game, the dialogue system will load the json file with the chosen language. As each language have their own separate json files, it's easy to be distributed to multiple translators of different languages.
Similar to the inventory system, the vendor UI parses a list of items and lists them in a scroll-able vendor menu. This allows designers to easily adjust what items to be sold.