I am going to have fun later huh (Refactoring)


Dev Author: Alex

Morning, afternoon, whatever time you read this, hope you are having a good day/night. For this latest sprint the team underwent, I noticed that most of my issues when programming tend to fall under "how creative can I be with this functionality while also keeping the code base clean?" As I keep writing code, I notice that I tend to make code that is somewhat inefficient. Thankfully, I have a laptop that can handle Unreal Engine 5 AND my weird programming, but I believe that if I spend time to refactor my code, it would allow me to write even more functionality.

For this reason, I started getting into the habit of creating base classes that other classes derive from it. The biggest example of this comes in the form of the base character class. I use this class to write logic that the player and sentry classes will eventually use (the original idea was to have the sentry as part of the base pickup class, but realizing that the sentry will require inputs from the user, I derived the sentry from the character). As of now, thankfully, most of the refactoring I made to the code base works, with the exception of the the controller HUD, which appears when the user presses tab, and is removed if the player presses tab again. For some reason, it only works for the player class, and not for the sentry class. Other than that, I found no issues. Will work on the sentry logic for the night time mode of the game (and hopefully not have to refactor code too much).

Get Lustrat Somnia

Leave a comment

Log in with itch.io to leave a comment.