Great video. Can you please do a small video on particles if I'm not asking too much. I loved your Bevy 2048 video course. Learnt about Array manipulation
Anything about particles in particular? I have a couple videos on bevy_hanabi but its probably time to do an updated one. I filed an issue to add them to the Asteroids game -- github.com/rust-adventure/asteroids/issues/2 Glad you enjoyed 2048!
Great video! Nice to see how you structure things and hear some reasoning behind it. Just one question: Why use a resource for the Pausable instead of another app state? I think you can have multiple, right?
You can have multiple states and it works just fine. In fact, there's an open PR[0] that looks like its about to merge which takes this a step further and introduces SubStates (states that only exist within other states) so it looks like I'll be revisiting this in 0.14 anyway. In this case, using Resources was an experiment. My first thought was to use SubStates but I was already aware of the above PR so I went with Resources. In the back of my mind I was curious about the design space that a bevy_plugin_pausable would require and the APIs it could offer. For example: is sending an event to pause a better API for a plugin like that? or letting people have manual control over a State/Resource. Would that plugin require additional data stored in the Resource? `.run_if(not(paused))` is kind of nice. etc. [0]: github.com/bevyengine/bevy/pull/11426 [1]: docs.rs/bevy/0.13.1/bevy/ecs/schedule/common_conditions/index.html
For the pause system I've been doing this and giving it an input_just_pressed run condition: fn toggle_pause_game( state: Res, mut next_state: ResMut, ) { match state.get() { GameState::Paused => next_state.set(GameState::Running), GameState::Running => next_state.set(GameState::Paused), } } Then using OnEnter/OnExit for the setup/teardown stuff. This would be equivalent to yours, right?
yeah pretty equivalent. Although the state-based approach is likely to win out in the long run. Bevy 0.14 is going to have ComputedStates and SubStates which allow you to derive states from other states, or have states that only exist inside other states.