Skip to content

Commit

Permalink
Merge branch 'main' into vscode-settings
Browse files Browse the repository at this point in the history
  • Loading branch information
janhohenheim committed Jul 7, 2024
2 parents 8e0422e + e98929e commit ad8b210
Show file tree
Hide file tree
Showing 9 changed files with 152 additions and 95 deletions.
82 changes: 41 additions & 41 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 0 additions & 26 deletions src/core/game/mod.rs

This file was deleted.

16 changes: 16 additions & 0 deletions src/core/loading/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
use bevy::core::FrameCount;
pub use bevy::prelude::*;

use super::AppState;

pub(super) fn plugin(app: &mut App) {
// Setup(s), update(s), teardown(s)
app.add_systems(Update, frames_elapsed.run_if(in_state(AppState::Loading)));
}

// Based on: <https://github.com/bevyengine/bevy/blob/v0.14.0/examples/window/window_settings.rs#L56>
fn frames_elapsed(mut next_app_state: ResMut<NextState<AppState>>, frames: Res<FrameCount>) {
if frames.0 >= 3 {
next_app_state.set(AppState::Ready);
}
}
Loading

0 comments on commit ad8b210

Please sign in to comment.