Camera centers at the top of the player, not bottom

This commit is contained in:
Edgaru089 2024-03-08 14:59:52 +08:00
parent 2c954c6d13
commit e58e82b21b

View File

@ -41,7 +41,9 @@ void camera_Advance(System_Camera *sys, Duration deltaTime) {
if (sys->target.size.x > EPS) if (sys->target.size.x > EPS)
tocenter = box2_Center(sys->target); tocenter = box2_Center(sys->target);
else if (sys->player) 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 else
return; return;