diff --git a/justfile b/justfile index 67f4ddd..d6e631b 100644 --- a/justfile +++ b/justfile @@ -8,7 +8,7 @@ native-dev: # Run native release native-release: - cargo run --release --no-default-features + RUSTC_WRAPPER=sccache cargo run --release --no-default-features # Run web dev web-dev: @@ -16,8 +16,17 @@ web-dev: # Run web release web-release: - trunk serve --release --no-default-features + RUSTC_WRAPPER=sccache trunk serve --release --no-default-features # Run tests test: RUSTC_WRAPPER=sccache RUST_BACKTRACE=full cargo nextest run --no-default-features --all-targets + +# Run CI localy +ci: + #!/bin/bash + set -e + cargo fmt --all -- --check + cargo clippy --workspace --all-targets --all-features -- --deny warnings + cargo doc --workspace --all-features --document-private-items --no-deps + cargo test --workspace --no-default-features diff --git a/src/constants.rs b/src/constants.rs index d603828..e806040 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -1,4 +1,4 @@ pub const MOVEMENT_THRESHOLD: f32 = 0.01; pub const WALL_OVERLAP_MODIFIER: f32 = 1.25; -pub const FLOOR_Y_OFFSET: u8 = 100; +pub const FLOOR_Y_OFFSET: u8 = 200; pub const MOVEMENT_COOLDOWN: f32 = 1.0; // one second cooldown diff --git a/src/floor/components.rs b/src/floor/components.rs index d0b0d7a..7056d24 100644 --- a/src/floor/components.rs +++ b/src/floor/components.rs @@ -6,10 +6,12 @@ pub struct Floor(pub u8); #[derive(Debug, Reflect, Component)] #[reflect(Component)] +#[require(Floor)] pub struct CurrentFloor; #[derive(Debug, Reflect, Component, Deref, DerefMut)] #[reflect(Component)] +#[require(Floor)] pub struct FloorYTarget(pub f32); impl Default for Floor { diff --git a/src/floor/systems/mod.rs b/src/floor/systems/mod.rs index 8428a20..43c50b2 100644 --- a/src/floor/systems/mod.rs +++ b/src/floor/systems/mod.rs @@ -15,8 +15,9 @@ pub(super) fn plugin(app: &mut App) { spawn_floor, despawn_floor, handle_floor_transition_events, - move_floors.after(handle_floor_transition_events), + move_floors, ) + .chain() .run_if(resource_exists::), ); } diff --git a/src/floor/systems/movement.rs b/src/floor/systems/movement.rs index bfe1e01..bb98dd7 100644 --- a/src/floor/systems/movement.rs +++ b/src/floor/systems/movement.rs @@ -12,10 +12,7 @@ use bevy::prelude::*; pub fn move_floors( mut commands: Commands, - mut maze_query: Query< - (Entity, &mut Transform, &FloorYTarget), - (With, With), - >, + mut maze_query: Query<(Entity, &mut Transform, &FloorYTarget), With>, player_query: Query<&MovementSpeed, With>, time: Res