diff --git a/Cargo.lock b/Cargo.lock index 6531503..c6c8e07 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2528,7 +2528,7 @@ dependencies = [ [[package]] name = "expedition_demo" -version = "0.3.0" +version = "0.4.0" dependencies = [ "bevy", "bevy_common_assets", diff --git a/Cargo.toml b/Cargo.toml index e3ab1e3..377927a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ cargo-features = ["codegen-backend"] [package] name = "expedition_demo" -version = "0.3.0" +version = "0.4.0" edition = "2024" [dependencies] @@ -10,12 +10,15 @@ bevy = { version = "0.18.0", features = ["bevy_remote", "debug", "experimental_b bevy_common_assets = { version = "0.15.0", features = ["toml"] } bevy_input = { version = "0.18.0", features = ["serde", "serialize"] } bevy_light_2d = "0.9.0" -bevy_rapier2d = { version = "0.33.0", features = ["rapier-debug-render"] } +bevy_rapier2d = { version = "0.33.0" } clap = { version = "4.6.0", features = ["derive"] } leafwing-input-manager = "0.20.0" serde = { version = "1.0.228", features = ["derive"] } toml = "1.0.3" +[features] +colliders = ["bevy_rapier2d/rapier-debug-render"] + [profile.dev] opt-level = 1 codegen-backend = "cranelift" diff --git a/src/layout/light.rs b/src/layout/light.rs index b4aee7d..f14380b 100644 --- a/src/layout/light.rs +++ b/src/layout/light.rs @@ -10,19 +10,17 @@ pub struct Lamp; pub fn lamp_bundle(textures: &Res, pos: Vec2, intensity: f32, radius: f32) -> impl Bundle { ( - SpotLight2d { - intensity, - radius, - source_width: meters(0.5), - cast_shadows: true, - ..default() - }, Transform::from_xyz(pos.x, pos.y, 0.), Sprite::from_image(textures.light.0.clone()), - children![ - ( - - ) - ], + children![( + SpotLight2d { + intensity, + radius, + source_width: meters(0.5), + cast_shadows: true, + ..default() + }, + Transform::from_xyz(0., 1., 0.), + )], ) } diff --git a/src/lib.rs b/src/lib.rs index 6a008ac..c087d58 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -98,6 +98,7 @@ impl Plugin for ExpeditionPlugin { }, }; app.add_plugins(( + #[cfg(feature = "colliders")] RapierDebugRenderPlugin::default(), RapierPhysicsPlugin::<()>::default() .with_custom_initialization(rapier_init),