I’m trying to rewrite the player module a bit so that I can integrate it with my own code and have some custom things like dashing and double jumping and something I’m doing is having a base character class and then my player class inherit from it since I plan to have enemies with similar behaviour which will inherit from the same base class. I wanted to know though if player code should just be its own thing instead of being a derived class? Or does it just depend on how I want to do it?
You may want the player module to be a sort of manager, and each character instance is an employee, or moreso a class. You can give each employee their own instructions, or properties, such as their agility stats, how they can move, where they can move, if they use pathfinding, etc.
The player module will save these in a characters table, key being the name of the character, and the value being the class (the employee), along with some data such as ID or the tick() it was made on.
You can decide here whether to process the employee’s instructions in the same module, or have seperate modules to do it for you.
This is how I personally would work with it however, and you might have differences in your workflow.