- Home /
How can I improve the organization and storing of information for my FPS Character Controller?
I am making a movement shooter. As of yet, I have made a simple(ish) character controller that can walk, sprint, slide, wall-run, jump, and double-jump.
The code itself is alright, and is free from any noticeable bugs at the moment, however, as a junior programmer and developer, I lack to experience to locate flaws in the way I am developing this game.
I have two scripts: CharacterController and StateController.
The StateController changes boolean values (isGrounded, isWallRunning, isSprinting) based on logic and input. (If the player presses LeftControl and is not crouching, then the bool isCrouching is set to true. But, if they press LeftControl and ARE crouching, isCrouching is set to false. I'll give one more example: if the player sliding, and they press jump, then they will stop crouching and jump. However if the player is crouching or crouch walking, they will only stop crouching. All the boolean states communicate to determine how to process a specific input).
The CharacterController executes private methods based on the boolean values in the SC, as well as the input. It's a bit more complex, so I won't bother explaining it here.
What I need to know is how I can modularize the code I have to make future coding easier. I.E. Should I used scriptable objects, should I use inheritance, how?