Add main menu and game over menu to breakout example#2927
Add main menu and game over menu to breakout example#2927ParthPant wants to merge 4 commits intobevyengine:mainfrom
Conversation
|
I like this! We should probably try to coordinate this with #2094 :) |
zimzat
left a comment
There was a problem hiding this comment.
Foreword: I'm just a bevy/rust noob so don't take my word as a given.
I'm definitely in favor of having more comprehensive game examples using states and what-not.
| .add_system_set(SystemSet::on_enter(GameState::GameOver).with_system(ui_system_setup)) | ||
| .add_system_set(SystemSet::on_update(GameState::GameOver).with_system(key_input_system)) | ||
| .add_system_set(SystemSet::on_exit(GameState::GameOver).with_system(teardown)) | ||
| .add_system_set(SystemSet::new().with_run_criteria(FixedTimestep::step(TIME_STEP as f64))) |
There was a problem hiding this comment.
It doesn't look like any systems are running under the timestep system set?
In my very limited experience, combining states or timesteps with any sort of custom run criteria is very difficult. The unofficial cheat book mentions it is possible to combine run criteria use some trickery to get around it but doesn't provide an example yet. Instead I've had to make do with simply moving custom criteria into the actual system itself (e.g. pulling in the active state as a argument) but that doesn't always work.
There was a problem hiding this comment.
hmm. I am not really sure about this. I think this should make all the systems run with fixed time step.
FizedTimeStep was first a part of the system set that had all the main game systems but when I added states, it overrode the state execution order. So I had to add this separately.
There was a problem hiding this comment.
Yeah, the incompatiblity here is really frustrating. This isn't your fault; it's a known serious Bevy limitation. See #2801 for some high-level planning on how we might restructure things to solve this.
|
Discussed with the docs team. This is great, but I'm going to close it out to keep the Breakout example simple and approachable :) Thanks! |
This PR adds a main menu and game over menu to the breakout example