From 437e512fd58fe92f30a8d05aa017bbc9b41b28a0 Mon Sep 17 00:00:00 2001 From: Franklin Date: Tue, 7 Nov 2023 21:08:15 -0400 Subject: [PATCH] Using PlayerValuesState instead of constants that hold playervalues --- src/comps/core/controller.rs | 9 +-- src/constants/mod.rs | 1 - src/constants/player_values.rs | 25 -------- src/logic/core/player/camera_player_sync.rs | 27 ++++---- src/logic/core/player/mod.rs | 1 + src/logic/core/player/player_movement.rs | 62 ++++++++++--------- src/logic/core/player/player_values_state.rs | 58 +++++++++++++++++ src/logic/core/player/player_vertical_sync.rs | 21 +++---- src/main.rs | 5 +- src/scenes/scene1/init.rs | 3 +- src/setup/spawners/player.rs | 13 ++-- src/ui/editor/plugin.rs | 1 + 12 files changed, 130 insertions(+), 96 deletions(-) delete mode 100644 src/constants/player_values.rs create mode 100644 src/logic/core/player/player_values_state.rs diff --git a/src/comps/core/controller.rs b/src/comps/core/controller.rs index 4510e31..8498095 100644 --- a/src/comps/core/controller.rs +++ b/src/comps/core/controller.rs @@ -1,9 +1,9 @@ use bevy::prelude::*; use bevy_rapier3d::prelude::*; -use crate::{logic::core::player::player_movement::{ +use crate::{logic::core::player::{player_movement::{ move_player, PlayerLinearXZState, PlayerLinearYState, PlayerMovementInput, -}, ui::game::settings::SettingsScreenUIConfiguration}; +}, player_values_state::PlayerValuesState}, ui::game::settings::SettingsScreenUIConfiguration}; use super::markers::player::Player; @@ -23,6 +23,7 @@ pub fn capture_input( >, time: Res