Joshua Haberzettl - Devlog #2 - Items and Chest Inventories


Items

For this sprint, the first thing I did was create items. I made an item class that extended ScriptableObject so that implementing new items will be a breeze -- all you have to do is create a blank item, assign it's values to whatever you so please, and bam you have a working item ready for implementation. The item class holds info about the item such as the name, description, and sprite, as well as what stats it will modify and how it modifies them. Right now items are simple and can only influence the player's stats, but in the future we plan to add ones that give special abilities such as an alternate dash, and one-time-use items like health potions.

Chest Inventory

When I started on this task, we already had an inventory for the player, but needed a way for chests to hold items to inevitably give the player when they open it. I abstracted out what was the player inventory and created a generic inventory Scriptable Object that just holds items, then had the original player inventory extend that one with the player-specific functionality. This way, we can add inventories to anything that may need to hold items like we did with our player and chest, as well as anything we add in the future such as shops.

I gave the chest an inventory, and made it so that when the chest is interacted with, it will randomly take one of the items from its inventory and add it to the player's. Thanks to this all being done with Scriptable Objects, we are also able to change the items available in chests at will by simply adding or removing them from the chest's inventory.

Get Whispering Abyss (2022)

Leave a comment

Log in with itch.io to leave a comment.