-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reorganize platformer example for readability #329
Reorganize platformer example for readability #329
Conversation
THIS. EXAMPLE. IS. A MESS! How can anyone learn from a haphazard jumble like this? It's like grabbing an armful of notes from a physicist's desk and calling it a textbook.... Anyway. I need to be able to sort through this, so I just decided to go ape. No logic was changed--it's just organized intuitively now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great PR, much appreciated.
This really highlights how bloated and unfocused this example has become over the years. It's definitely overdue for some refactoring and this is great start.
I just have one non-NIT about the ladder registration, assuming CI passes
Clippy job should be fixed after #331 |
If we're consolidating related logic, it really does make sense to put all wall-related logic in a plugin.
Only there's an existing plugin for the climbing system.
Because that's all that's left after "ground_detection" is split off. (Also technically there's no physics calculations being done here.)
Alright, changes complete. |
The components and systems in the platformer example are confusingly sorted: components are stored in a separate file from the systems that use them, and within those files the components & systems are jumbled chaotically with little rhyme or reason. In a crate example this complex, this organization scheme makes understanding the code a real challenge (which is a major reason I couldn't update this example in #294).
This PR reorganizes the platformer example into modules sorted roughly by "part of the game" or "game system" (camera system, climbing, inventory, etc.). Each module contains both the components and ECS systems specific to that part, to present a complete picture of what the game system does and how it works.
No game logic has been changed. This PR focuses purely on code quality.