UI Mayhem!


Grabbing all related information can be rough when you don't preplan for everything from the get go! 
While developing the in game UI, we wanted to display our stats for the player on the side during the pause menu. This ended up being a lot of lines, hardcoding each value with a name as we originally setup stats to be singly float values, no other information. Although this doesn't directly affect the user (YOU!), it can affect the speed in which we add in changes and how those values differ from the defaults. 
After a bit of team discussion, we turned around and made a cozy little struct to house this information, allowing us to store the name of this stat, the base value of it, a copy of the current modifier on this stat (whether it is positive or negative!), and any other information we may choose to add in the future.

As you can see in the above image, this takes our (potentially 100's of lines long) code and shrink it down to a cozy little for loop, no matter how many new stats we decide to add. As seen in the following image:

In the end, I hope we can bring a little better communication and pre-planning to ourselves to save a little time about our design decisions. But this is also part of the process of growing as a team and learning how each other codes and makes design decisions!

Get Banana Hell

Leave a comment

Log in with itch.io to leave a comment.