From e58e82b21b9152b758b334d5bffb70385eecada2 Mon Sep 17 00:00:00 2001 From: Edgaru089 Date: Fri, 8 Mar 2024 14:59:52 +0800 Subject: [PATCH] Camera centers at the top of the player, not bottom --- camera.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/camera.c b/camera.c index 265443a..3ba24db 100644 --- a/camera.c +++ b/camera.c @@ -41,7 +41,9 @@ void camera_Advance(System_Camera *sys, Duration deltaTime) { if (sys->target.size.x > EPS) tocenter = box2_Center(sys->target); else if (sys->player) - tocenter = sys->player->super->position->position; + tocenter = vec2_Add( + sys->player->super->position->position, + vec2(0, -sys->player->super->hitbox->box.size.y)); else return;