NiklasEi / bevy_game_template

Template for a Bevy game including CI/CD for web, Windows, Linux, macOS, iOS and Android
https://niklasei.github.io/bevy_game_template/
Creative Commons Zero v1.0 Universal
847 stars 89 forks source link

Refactor plugins; Highlight debug-assertions in Cargo.toml #37

Closed wanderrful closed 1 year ago

wanderrful commented 2 years ago

Hi there,

I found it more useful to isolate all of the starter, default plugins, logic, etc into its own "default" folder, so that I can better decouple the bevy_game starter template from the additional things I want to add to the project.

Also, incidentally it shows users of this template how they can organize their own code as well.

Lastly, I added a debug-assertions line in the Cargo.toml so that it's more obvious to users of this template how they can disable the default "frame diagnostic" logging that would otherwise normally flood stdout whenever they run the application.

edit - Also, by using public and private, it sets a good example for the users of this template to follow, so that their code is more organized and not just 5_000 lines in a single file.

NiklasEi commented 2 years ago

Hey, sorry for the long silence and thank you for opening a PR.

I found it more useful to isolate all of the starter, default plugins, logic, etc into its own "default" folder, so that I can better decouple the bevy_game starter template from the additional things I want to add to the project.

In my opinion, the way to use this template would be to modify the existing plugins and add your own ones on the same level. I think in the end it should not be visible anymore that a project was started from the template. That's why I do not want to move the existing plugins into a separate directory. They should live together with the user's code; they should become the user's code.

Lastly, I added a debug-assertions line in the Cargo.toml so that it's more obvious to users of this template how they can disable the default "frame diagnostic" logging that would otherwise normally flood stdout whenever they run the application.

Debug assertions get disabled by default when you build with --release. If you do not want to have them in debug builds, the log plugins can be deleted. Maybe it would help to add a comment in the code pointing to release builds?

edit - Also, by using public and private, it sets a good example for the users of this template to follow, so that their code is more organized and not just 5_000 lines in a single file.

Can you elaborate on which items should be private and are public on main?

I like the new window plugin :+1:

NiklasEi commented 1 year ago

I will close this for now. Feel free to comment here or open a new PR if you would like to contribute parts like the window plugin :slightly_smiling_face: