diff --git a/src/debug_diagnostic.rs b/src/debug_diagnostic.rs index 5256a28..4313fd4 100644 --- a/src/debug_diagnostic.rs +++ b/src/debug_diagnostic.rs @@ -19,8 +19,9 @@ impl Plugin for DiagnosticPlugin { .chain(), ) .add_systems(Update, (fps_counting, sheep_counter_text)); - - #[cfg(debug_assertions)] { + + #[cfg(debug_assertions)] + { app.add_plugins(bevy_inspector_egui::quick::WorldInspectorPlugin::default()); } } diff --git a/src/lib.rs b/src/lib.rs index 70579e9..ef4cd00 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -40,7 +40,6 @@ impl Plugin for GamePlugin { #[cfg(debug_assertions)] { - app.add_plugins((FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin::default())); } @@ -60,7 +59,6 @@ impl Plugin for GamePlugin { app.insert_resource(Time::::from_seconds(1.0)); app.add_systems(Startup, (test_level::setup, sheep::setup)); - } } diff --git a/src/main.rs b/src/main.rs index 7fda941..46951e9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,6 +9,7 @@ use bevy::DefaultPlugins; use bevy_game::GamePlugin; // ToDo: Replace bevy_game with your new crate name. use bevy::asset::AssetMetaCheck; +use bevy_game::test_level::LevelSize; use std::io::Cursor; use winit::window::Icon; @@ -17,6 +18,7 @@ fn main() { .insert_resource(Msaa::Off) .insert_resource(AssetMetaCheck::Never) .insert_resource(ClearColor(Color::rgb(0.4, 0.4, 0.4))) + .init_resource::() .add_plugins( DefaultPlugins .set(WindowPlugin { diff --git a/src/physics.rs b/src/physics.rs index 159638d..fe20d55 100644 --- a/src/physics.rs +++ b/src/physics.rs @@ -4,10 +4,7 @@ pub struct PhysicsPlugin; impl Plugin for PhysicsPlugin { fn build(&self, app: &mut App) { - app.add_systems(Update, ( - walk_system, - apply_velocity, - ).chain()); + app.add_systems(Update, (walk_system, apply_velocity).chain()); } } @@ -27,15 +24,12 @@ pub struct WalkController { pub max_speed: f32, } -fn walk_system( - time: Res