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)
Whispering Abyss (2022)
Top-down Lovecraftian Horror With a Profuseness of Items
More posts
- Matt McL - Dev Log #8 - 6/03/2022Jun 04, 2022
- Paul Harden DevLog #9 - 4/26/22May 19, 2022
- CarlIsaac Nicolas - Devlog #9May 16, 2022
- CarlIsaac Nicolas - Devlog #8May 16, 2022
- CarlIsaac Nicolas - Devlog #7May 16, 2022
- CarlIsaac Nicolas - Devlog #6May 16, 2022
- CarlIsaac Nicolas - Devlog #5May 16, 2022
- CarlIsaac Nicolas - Devlog #4 - 3/8/2022May 16, 2022
Leave a comment
Log in with itch.io to leave a comment.