From 24df81424bd017c1e24535bceec1130d9ed693d9 Mon Sep 17 00:00:00 2001 From: Franklin Date: Thu, 23 Nov 2023 17:28:48 -0400 Subject: [PATCH] High ready + Low ready system. With animations and logic flows with sprinting, shooting, reloading, and aiming --- Design.md | 7 ++- assets/character/main_character.glb | Bin 49370308 -> 49370308 bytes src/comps/core/controller.rs | 5 ++- src/logic/core/guns/inspect.rs | 31 +++++++++++++ src/logic/core/guns/mod.rs | 1 + src/logic/core/guns/player_firing.rs | 11 +++++ src/logic/core/guns/shoot.rs | 34 +++++++------- src/logic/core/player/hands.rs | 55 +++++++++++++++++++---- src/logic/core/player/player_movement.rs | 18 +++++--- src/logic/core/player/player_settings.rs | 7 ++- src/scenes/scene1/init.rs | 3 +- src/setup/equipment.rs | 9 ++++ 12 files changed, 145 insertions(+), 36 deletions(-) create mode 100644 src/logic/core/guns/inspect.rs diff --git a/Design.md b/Design.md index 8188716..b33e27f 100644 --- a/Design.md +++ b/Design.md @@ -23,12 +23,17 @@ Multiplayer - [x] Snap back leaning too quick - [x] Issue with moving around quickly - [x] Bring Crouching back -- [ ] Inspect animation (procedural) +- [x] Inspect animation & state (procedural) + - [ ] Attachment editor system when in inspect mode +- [x] High Ready & Low Ready system with state + - [x] High ready animation (procedural) + - [x] Low ready animation (procedural) - [ ] Reload animation (procedural) - [ ] Real world magazines - [ ] Rewriting bullet physics to use raycasts & kinematic rigidbodies (logic controlled) - [ ] Low Ready & High ready (low ready == more speed | high ready == more accuracy) - [ ] Auto Low ready when gun collider hits object OR when player starts sprinting +- [ ] Create a Controls struct that holds mappings to all the game keys and replace them in all the game's code # Design diff --git a/assets/character/main_character.glb b/assets/character/main_character.glb index 986337b3eeb1fe9783929846d722ed9ef1473503..50445edb695df4d570c39ec82469e52bca3cba90 100644 GIT binary patch delta 3557 zcmXBUQ*amx5J1ssYTLHkG)>c{wr$(CZQHhOGqsW0cAu?#=k3frvw!=yVVlk-4Wpg= z!qOHD4Gjqm4h+c`R47+qo}j@0Cn&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cBW0zWl$Q!pQ7TDgsUlUSnpBq>Qd4S4ZK)%5rJmH62GUR(Nn>duO{JMMmlo1e zT1jhZBWwmdH|BCd*}o ztdv!u6tCdcK3 zoRm{?TFywgoRxEOUM|Q*xg?k6id>aza$Ro7O}QnvB|`4VUAZUs<$*kuNAg&n$WwVH z&*g=@lvnav-pE^dC-3Ehe3Vb}S-!|u`6l1X5Avh@BtOe9@~iwNzsn!;r~D;<%Rln3 z{1=J&3*d+(0TNlFNK}a?(Itk&lvom5;z(SHC-EhLB$PywSdvImNhZl9g`|{Jl3LP8 zT1hAAC4*#?Op;l$NLI-v*(HbMlw6Wq@PVR?=G9NLy(q?WKcslupuFx=2^)Cf%in^psxGTlz>}=_mbVfDDvDGFXPlP#Gq} zWrU2B?_`vWmN7C`#>se@AQNShOqMA!Ri?>wnISV}mdutpGFRrwd|4n1WsxkFC9+hO z$#PjCD`l0emNl|g*2#L=ARA?qY?dvuRkq1?*&#b+m+Y23vRC%WemNiq<&YefBXU%Z z$#FR$C*_o!mNODAXXTunmkV-HF3DxNB3I>_T$dYiQ*Oy^iI6*TSMJGuc_0tvkvx_s p@>HJ5b9o^z<(0gaH}Y2A$$R-AALWyLmM`*Ez6G3M{sIPd`5(Z+vrYg2 diff --git a/src/comps/core/controller.rs b/src/comps/core/controller.rs index e36e066..fd6656f 100644 --- a/src/comps/core/controller.rs +++ b/src/comps/core/controller.rs @@ -2,12 +2,12 @@ use bevy::prelude::*; use bevy_rapier3d::prelude::*; use crate::{ - logic::core::player::{ + logic::core::{player::{ player_movement::{ move_player, PlayerLinearXZState, PlayerLinearYState, PlayerMovementInput, }, player_values_state::PlayerValuesState, - }, + }, guns::player_firing::PlayerFiringInfo}, ui::game::game_ui_state::GameUiState, }; @@ -24,6 +24,7 @@ pub fn capture_input( &mut PlayerLinearXZState, &mut Transform, &mut Damping, + &mut PlayerFiringInfo, ), With, >, diff --git a/src/logic/core/guns/inspect.rs b/src/logic/core/guns/inspect.rs new file mode 100644 index 0000000..b5656ad --- /dev/null +++ b/src/logic/core/guns/inspect.rs @@ -0,0 +1,31 @@ +use bevy::prelude::*; + +use crate::comps::core::markers::{proxy::{character::in_player_hands_parent::InPlayerHandsParent, physics::utils::TransformExt}, player::Player}; + +use super::player_firing::PlayerFiringInfo; + + + +pub fn inspect_firearm( + //mut commands: Commands, + mut in_player_hands_parent_query: Query<&mut Transform, With>, + mut player_firing_info_query: Query<&mut PlayerFiringInfo, With>, + time: Res