From 23d32213ff8832d2c4360618eb511a0098153818 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Sat, 23 Mar 2024 08:53:12 +0100 Subject: feat: camera movement --- src/client.rs | 25 +++++++++++++++++++++++++ src/server.rs | 14 ++++++++------ 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/client.rs b/src/client.rs index 6fa6ff1..7f1220e 100644 --- a/src/client.rs +++ b/src/client.rs @@ -94,6 +94,7 @@ impl Plugin for ClientPlugin { .chain(), ), ) + .add_systems(Update, move_camera) .add_systems( FixedPreUpdate, buffer_input.in_set(InputSystemSet::BufferInputs), @@ -790,3 +791,27 @@ fn health_indicator_despawn( commands.entity(entity).despawn(); } } + +const CAMERA_MOVEMENT_SPEED: f32 = 100.; + +fn move_camera( + mut cameras: Query<&mut Transform, With>, + players: Query<(&PlayerId, &PlayerPosition, &Shape)>, + client_id: Res, + time: Res