Posted March 31, 2024 by Bjornoid
Problem:
One of our games most important B tier features, was having perks in the game that would boost stats or give you cool abilities. These perks would also be bought with the in game point system, and are inspired from Call of Duty Zombies soda perk machines, except ours are Ice Cream Machines! We feel as though these perks not only add some more sense of accomplishment for the player, but also allow the player to survive longer against the increasingly difficult rounds of zombies. More upgrades and high powered weaponry is intended to come out soon as well for the latter. Before getting started with the system, I knew it was going to inherit from base interactable, and that I could make one singular perk machine class that would have "instance editable" and "expose on spawn" variables that would allow me to set each instance of the class to be what I want it to be.
Solution:
First, I added a new custom Enum to distinguish the different perks.
I then setup the switch statement logic in the perk machine class to give the player interacting the specific upgrades for that perk. The perk variable itself is expose on spawn and instance editable so that each perk machine class dragged in the level will be set to which perk it should give you.
So far I've fully implemented the Health, Rate of Fire/Ammo perk, and the revive perk. I also added the functionality to add UI to show what perks you have, and made placeholder images for them for now. The last thing to do that is yet to be done is having a eating animation of the ice cream accompanied by a sound effect.