Sometimes Math is Hard


Author: Devon Flynn

Posted on 6/26/2025

 

This week, my main focus was implementing our Roguelike card system. This system let’s a player choose one of three random cards that will affect their health, speed, or stamina stats. In creating the SetStats function on the Player Character script, I ran into quite a few issues with implementing the math adjustment. Since the stat modifier is just a percentage, my initial thought was to multiply the original stat by the modifier.

After some brief play testing, I realized that this equation would change the original stat to the percentage of the modifier. For instance, if health was 50 and the modifier was 5%, it would set the original stat to 2.5. Math is not my strong suit, so this took me longer to figure out than I care to admit. Ultimately, I figured out that I needed to multiply the original stat by the modifier, then add that to the original stat. Once I implemented that equation, the stat changes began working beautifully.


Get Zombats

Leave a comment

Log in with itch.io to leave a comment.