diff --git a/Readme.md b/Readme.md index afd3ea9..c12d810 100644 --- a/Readme.md +++ b/Readme.md @@ -1,3 +1,5 @@ # Experimental game -- [ ] Skybox +- [x] Skybox +- [x] Glitch: Fall does not remove linear damping, only after jump +- [x] Glitch: Negative linear damping on jump allows for bunny hopping diff --git a/assets/skybox/.DS_Store b/assets/skybox/.DS_Store index 9b4ea73..770175c 100644 Binary files a/assets/skybox/.DS_Store and b/assets/skybox/.DS_Store differ diff --git a/src/constants/player_values.rs b/src/constants/player_values.rs index f0e5b19..7f4cb28 100644 --- a/src/constants/player_values.rs +++ b/src/constants/player_values.rs @@ -13,7 +13,7 @@ pub const PLAYER_CAMERA_HEIGHT: f32 = 1.0; pub const PLAYER_CROUCH_HEIGHT: f32 = 0.0; pub const PLAYER_LINEAR_DAMPING: f32 = 3.5; -pub const PLAYER_LINEAR_DAMPING_WHILE_JUMPING: f32 = -0.5; +pub const PLAYER_LINEAR_DAMPING_WHILE_JUMPING: f32 = 0.25; pub const PLAYER_LATERAL_ACCELERATION_WHILE_SPRINTING_MULTIPLIER: f32 = 0.2; pub const PLAYER_LATERAL_ACCELERATION_MULTIPLIER: f32 = 1.0; diff --git a/src/logic/core/player/player_vertical_sync.rs b/src/logic/core/player/player_vertical_sync.rs index 7cc1618..81b66c9 100644 --- a/src/logic/core/player/player_vertical_sync.rs +++ b/src/logic/core/player/player_vertical_sync.rs @@ -1,7 +1,7 @@ use bevy::prelude::*; use bevy_rapier3d::prelude::*; -use crate::{comps::core::markers::player::Player, constants::player_values::{PLAYER_LINEAR_DAMPING, PLAYER_JUMP_COOLDOWN_MS, PLAYER_LINEAR_DAMPING_TIME_OFFSET_AFTER_JUMP_IN_MS}}; +use crate::{comps::core::markers::player::Player, constants::player_values::{PLAYER_LINEAR_DAMPING, PLAYER_JUMP_COOLDOWN_MS, PLAYER_LINEAR_DAMPING_TIME_OFFSET_AFTER_JUMP_IN_MS, PLAYER_LINEAR_DAMPING_WHILE_JUMPING}}; use super::player_movement::PlayerLinearYState; @@ -13,6 +13,7 @@ pub fn sync_player_y_state( for (player_velocity, mut player_linear_y_state, mut player_damping) in &mut query { if player_velocity.linvel.y < -1.0 { *player_linear_y_state = PlayerLinearYState::Falling; + *player_damping = Damping { linear_damping: PLAYER_LINEAR_DAMPING_WHILE_JUMPING, ..Default::default() }; } else if player_velocity.linvel.y >= -1.0 && player_velocity.linvel.y <= 1.0 { let previous_grounded_time = match *player_linear_y_state { PlayerLinearYState::Grounded(grounded_for) => grounded_for,