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
Zombats
Third-person Ability Shooter
Status | In development |
Authors | Wombat Studios, JRarrat, Josh The Dark, iWannaNuhh, aabunada, Devon Flynn |
Genre | Action |
Tags | 3D, Third-Person Shooter, Zombies |
More posts
- Damage Feedback: Ragdoll Deaths and Screen Flash71 days ago
- Shattering Expectations - Ben Bissett71 days ago
- The Journey to Multiplayer, Part 3 - Joshua Newton72 days ago
- Audio in C++ - Ali Abunada72 days ago
- Guns and Ballistics - Ben Bissett77 days ago
- Proper Ragdolling - Ali Abunada77 days ago
- Wave Based Spawning and Spawner Management77 days ago
- The Journey to Multiplayer, Part 2 - Joshua Newton78 days ago
- Pause Menu Doubling78 days ago
Leave a comment
Log in with itch.io to leave a comment.