You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a few important patterns that can be used for writing reusable, more abstrated Bevy code.
Generic systems (already has an example).
Methods on component and resource types.
The SystemParam derive.
The WorldQuery derive.
The second often makes beginners nervous (seperate your data and logic!!), while the latter two are hard-to-discover, full of irrelevant unsafe and tricky to figure out how to use.
We should have an example demonstrating how and why to use these tools, in a moderately realistic setting. For methods, I'd demonstrate encapsulation, maybe with a nice validated setter pattern.
This should be covered in more depth in the book, but for now I think a short example would serve as a nice breadcrumb.
Additional Context
bevyengine/rfcs#68 will make working with and defining methods on the WorldQuery derive much nicer.
The text was updated successfully, but these errors were encountered:
It would also help if the SystemParam and WorldQuery trait docs had a Description section that attempts to sell itself to newcomers. Answering questions like "Why would I use this?" "Why a game needs this?" "What kind of problems does this solve?"
These two traits and their derives would be useful to have mentioned and covered in official tutorials and books, even if lightly, just to demystify their usage and show that this is not some sort of internal stuff, but intended for games to use.
How can Bevy's documentation be improved?
There are a few important patterns that can be used for writing reusable, more abstrated Bevy code.
The second often makes beginners nervous (seperate your data and logic!!), while the latter two are hard-to-discover, full of irrelevant unsafe and tricky to figure out how to use.
We should have an example demonstrating how and why to use these tools, in a moderately realistic setting. For methods, I'd demonstrate encapsulation, maybe with a nice validated setter pattern.
This should be covered in more depth in the book, but for now I think a short example would serve as a nice breadcrumb.
Additional Context
bevyengine/rfcs#68 will make working with and defining methods on the
WorldQuery
derive much nicer.The text was updated successfully, but these errors were encountered: