cjddmut / Unity-2D-Platformer-Controller

A customizable 2D platformer motor that handles mechanics such as double jumps, wall jumps, and corner grabs. Includes a player controlled prefab that can be dropped into any scene for immediate support.
MIT License
868 stars 163 forks source link

WorldCollider and Plugin system. #42

Closed llafuente closed 7 years ago

llafuente commented 8 years ago

Hi @cjddmut,

I already have implemented Push/Pull boxes and Water. But before refining all my implementations (ladder included) and before adding ropes.

I think we can discuss some mayor changes that I will introduce and why... I hate that all logic is in a single file with all private. Everything is private for no reason.

I would like to have a WorldCollider/PlatformerCollider component, that manage all basic collisions (ground, moving platforms, walls) And the all sort of plugins. Jump, Dash, Water, Ladders on top as extra components

I have a POC at isolation branch, here is the diff: https://github.com/cjddmut/Unity-2D-Platformer-Controller/compare/develop...llafuente:isolation

Also the plugin system wich i use for developing water and grab. it add a silly hook to velocity but works and can be extended when a new plugin requires a new hook.

POC: https://github.com/cjddmut/Unity-2D-Platformer-Controller/compare/develop...llafuente:box2

Any suggestions?

cjddmut commented 8 years ago

I'm fine with suggestions on breaking up the logic into other files, or even components. But there's a trade off right? By making every feature a different component it adds to the overhead of the user having to manage it.

I disagree with "Everything is private for no reason." It certainly has it's purpose. By opening up all data and logic to public it convolutes what the user needs to try to figure out to use the package. Tons of information is just noise when you don't know how to parse it which can make it more difficult then it needs to be.

llafuente commented 7 years ago

Closing this, because I'm not using this library anymore.