place core to start the game

This commit is contained in:
Jim 2025-09-01 21:54:50 -04:00
parent 3a25a1bd87
commit 1ecd054a31
Signed by: jim
GPG key ID: 3D7D94BA53088BF4
8 changed files with 67 additions and 24 deletions

View file

@ -39,11 +39,15 @@ fn pause_screen(mut contexts: EguiContexts) {
fn toggle_pause(
state: Res<State<GameState>>,
mut removed_cancellations: RemovedComponents<Cancellable>,
mut next_state: ResMut<NextState<GameState>>,
query: Query<(), With<Cancellable>>,
) {
if !query.is_empty() {
// sometimes race condition can happen where the cancellable component gets cancelled before this system runs
// instead of actually scheduling systems, I will just do this.
if !query.is_empty() || !removed_cancellations.is_empty() {
// cancelling takes priority over pausing
removed_cancellations.clear();
return;
}
let next = match state.get() {