From 8e739de9bc5c198c206502a4b75370438cb8bb24 Mon Sep 17 00:00:00 2001 From: Franklin Date: Tue, 12 Sep 2023 09:58:58 -0400 Subject: [PATCH] Added jumping, grounded and falling states. Modified force and gravity --- src/comps/core/controller.rs | 4 +- src/constants/player_values.rs | 5 ++- src/logic/core/player/mod.rs | 3 +- src/logic/core/player/player_movement.rs | 42 ++++++++++++++++--- src/logic/core/player/player_vertical_sync.rs | 24 +++++++++++ src/logic/core/player/spawn_player.rs | 9 ++-- src/main.rs | 4 +- src/scenes/scene1/init.rs | 3 +- 8 files changed, 79 insertions(+), 15 deletions(-) create mode 100644 src/logic/core/player/player_vertical_sync.rs diff --git a/src/comps/core/controller.rs b/src/comps/core/controller.rs index e9ef804..e595393 100644 --- a/src/comps/core/controller.rs +++ b/src/comps/core/controller.rs @@ -1,12 +1,12 @@ use bevy::prelude::*; use bevy_rapier3d::prelude::*; -use crate::logic::core::player::player_movement::{PlayerMovementInput, move_player}; +use crate::logic::core::player::player_movement::{PlayerMovementInput, move_player, PlayerLinearYState}; use super::markers::player::Player; /// System that captures input and fires events -pub fn capture_input(keyboard_input: Res>, query: Query<(&mut Velocity, &mut ExternalImpulse), With>, time: Res