From 0d07fa232993e8df7934c6d5caafa81ba07455ff Mon Sep 17 00:00:00 2001 From: Franklin Blanco Date: Fri, 15 Sep 2023 19:26:39 -0700 Subject: [PATCH] added aiming --- src/comps/core/controller.rs | 2 ++ src/logic/core/player/hands.rs | 25 ++++++++++++++++++++++++ src/logic/core/player/player_movement.rs | 8 +++++++- src/scenes/scene1/init.rs | 9 ++++++--- src/scenes/scene1/obstacles.rs | 2 +- 5 files changed, 41 insertions(+), 5 deletions(-) diff --git a/src/comps/core/controller.rs b/src/comps/core/controller.rs index b5897c1..6fe68ac 100644 --- a/src/comps/core/controller.rs +++ b/src/comps/core/controller.rs @@ -47,6 +47,8 @@ pub fn capture_input( front: keyboard_input.pressed(KeyCode::W), back: keyboard_input.pressed(KeyCode::S), sprint: keyboard_input.pressed(KeyCode::ShiftLeft), + lean_left: keyboard_input.pressed(KeyCode::Q), + lean_right: keyboard_input.pressed(KeyCode::E), }; move_player(player_movement_input, player_query, time); } diff --git a/src/logic/core/player/hands.rs b/src/logic/core/player/hands.rs index 8b13789..448cffa 100644 --- a/src/logic/core/player/hands.rs +++ b/src/logic/core/player/hands.rs @@ -1 +1,26 @@ +use bevy::prelude::*; +use crate::comps::core::markers::player::PlayerHand; + +pub fn capture_hand_usage( + mouse_buttons: Res>, + mut query: Query<&mut Transform, With>, + time: Res