From 50544b06bf42320f632c935844aa72075b687bdd Mon Sep 17 00:00:00 2001 From: hheik <4469778+hheik@users.noreply.github.com> Date: Sun, 18 Dec 2022 06:17:17 +0200 Subject: [PATCH] feat: First iteration of character controller overhaul --- src/game/kinematic.rs | 93 ++++++++++++++++++++---------------- src/game/player.rs | 4 -- src/terrain2d/chunk2d.rs | 8 +++- src/util.rs | 2 + src/util/collision_layers.rs | 9 ++++ 5 files changed, 68 insertions(+), 48 deletions(-) create mode 100644 src/util/collision_layers.rs diff --git a/src/game/kinematic.rs b/src/game/kinematic.rs index b3c6825..511adf6 100644 --- a/src/game/kinematic.rs +++ b/src/game/kinematic.rs @@ -70,13 +70,13 @@ pub struct KinematicProperties { impl Default for KinematicProperties { fn default() -> Self { Self { - ground_speed: 100.0, + ground_speed: 75.0, ground_acceleration: 20.0, ground_friction: 30.0, - air_speed: 100.0, + air_speed: 75.0, air_acceleration: 10.0, air_friction: 10.0, - jump_height: 150.0, + jump_height: 100.0, gravity: Some(1.0), } } @@ -90,7 +90,6 @@ pub struct KinematicInput { } fn kinematic_movement( - time: Res