From b6fe9d420e5eab0df79e05b8353e19865e79c0f0 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Wed, 2 Jun 2021 16:53:35 -0500 Subject: [PATCH] Introduce physics to movement controls. --- src/navigation.rs | 71 ++++++++++++++++++++-------------------------- src/pathfinding.rs | 11 +++---- 2 files changed, 36 insertions(+), 46 deletions(-) diff --git a/src/navigation.rs b/src/navigation.rs index 20bd2d0..ab55ea9 100644 --- a/src/navigation.rs +++ b/src/navigation.rs @@ -58,10 +58,6 @@ pub struct Speed(pub f32); #[reflect(Component)] pub struct Sprinting; -#[derive(Clone, Copy, Debug, Default, Deref, DerefMut, Reflect)] -#[reflect(Component)] -pub struct Velocity(pub Vec2); - #[derive(Clone, Copy, Debug)] pub struct Collision { pub entity: Entity, @@ -105,31 +101,25 @@ fn movement_controls( config: Res>, input: Res>, time: Res