From a0646dbf453a897e497d4d0977a1ff841413007a Mon Sep 17 00:00:00 2001 From: hheik <4469778+hheik@users.noreply.github.com> Date: Sat, 2 Dec 2023 16:30:27 +0200 Subject: [PATCH] Fixed mouse movement --- src/game/camera.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/camera.rs b/src/game/camera.rs index 923baf9..29344aa 100644 --- a/src/game/camera.rs +++ b/src/game/camera.rs @@ -128,14 +128,14 @@ fn free_system( if mouse_input.pressed(MouseButton::Middle) { motion += raw_mouse_motion * projection.scale * Vec2::new(-1.0, 1.0); } - motion.x = match (key_input.pressed(KeyCode::A), key_input.pressed(KeyCode::D)) { + motion.x += match (key_input.pressed(KeyCode::A), key_input.pressed(KeyCode::D)) { (true, false) => -1.0, (false, true) => 1.0, (_, _) => 0.0, } * projection.scale * time.delta_seconds() * 100.0; - motion.y = match (key_input.pressed(KeyCode::S), key_input.pressed(KeyCode::W)) { + motion.y *= match (key_input.pressed(KeyCode::S), key_input.pressed(KeyCode::W)) { (true, false) => -1.0, (false, true) => 1.0, (_, _) => 0.0,