Add example and short section about schedule in the introduction chapter of the book
A-BookC-Content
About the Bevy book:
I think the "introduction" chapter is missing two things:
- explaining what a schedule is and giving just two examples: Startup and Update
- giving an example that ties everything together.
### Schedule
Introducing the schedules could be as simple as "Each system is added to a schedule to know when and in which order they're called. If you're making a very simple app you can spawn things once in Startup and do things each frame in Update. You can of course have a finer control of when or on which conditions things are executed, see [advanced schedule section]".
### Example
While I love databases and got hooked pretty quickly with Bevy, a lot of tutorials or stuff start by introducing concept but never show you what a full program looks like so everything that is presented to you is nebulous.
This makes me (and I assume other people) frustrated/bear a cognitive load of "okay I'm supposed to do it this way but where do I put this/how do I make in work in practice", and adds friction that may make them give up if they were just trying to figure out "what a Bevy app looks like".
Introducing an example would reduce that friction.
The example could be something very simple that might not even require a window just writing to console, spawns a bunch of entities at startup then do a basic operation on them based on a resource setting and print to console every frame?
The example could be shown at the beginning of the chapter with arrows (would probably require it to be an image) pointing at the concepts that will be introduced. In this section it would explain briefly what it does but not go into details, just saying something like "those will be the main concepts that Bevy is working with and we'll introduce now".
Then after the concepts have been introduced in the chapter you show the example again at the end of the chapter and explain it.
Arrows would typically point to two `Entity`/entity (`commands.spawn` line + iter or a Query), a `Component` (inside `command.spawn` and iter of Query), a `System` (the function definition and when it's added to the scheduler), a `Resource`, a `Query`, `Commands`/a command (the parameter and a `commands.spawn` line), the `App`, and a `Schedule`.
Example of what the example could be: You spawn three entities with a Bomb component with a counter inside, each frame they write to console what their counter are, and decrement it based on a resource, when they reach zero, they stop writing (/they despawn?)
0 条评论