
Overview
A reusable 2D player controller developed for Unity platformers, designed with extensibility as the primary goal. The base controller handles all core movement and ability logic, and game-specific features are added by extending - not modifying - the base code.
The controller has been used as the foundation for other projects.

Base Controller
The base controller handles all core movement and ability logic such as running, jumping, and enabling or disabling abilities. Game-specific features are added by either adding additional abilities or effects, which can be enabled or disabled at runtime.
The player controller operates with a blackboard to store state. Abilities and effects can match against this state to determine if they're valid for the situation. For example, you can only jump if you're on the ground, or have the double jump ability and it hasn't been used yet.

Ability Extensibility
Adding more abilities is the first obvious need for extension. Adding abilities such as a blink with time dilation and a cursor could easily be done by adding an ability module with rules for when it can be used.

Environment Extensibility
Environmental substances such as bouncy pads and water were able to modify character physics without any changes to the base controller code. Each substance type is self-contained and can be dropped into any scene.

Reskinning and animations
By updating the animator, adding additional abilities, and adjusting the physics properties of the controller to fit the game, the player controller was ready to go for another project.