From b4d4e4bd6c25655dd0f7bd5f6b377a74429bf012 Mon Sep 17 00:00:00 2001 From: ne_mene Date: Tue, 7 Apr 2026 23:38:39 +0200 Subject: fixed camera shake rounding --- src/camera.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/camera.lua') diff --git a/src/camera.lua b/src/camera.lua index add6ae4..81f1657 100644 --- a/src/camera.lua +++ b/src/camera.lua @@ -59,8 +59,8 @@ end function use_camera_transform() local w, h = SCR_WIDTH / 2, SCR_HEIGHT / 2 lg.scale(active_cam.zoom) - local ox, oy = round(-active_cam.realx + w / active_cam.zoom), - round(-active_cam.realy + h / active_cam.zoom) + local ox, oy = -active_cam.realx + w / active_cam.zoom, + -active_cam.realy + h / active_cam.zoom local shakex, shakey = 0, 0 if active_cam.shake_timer > 0 then @@ -77,5 +77,7 @@ function use_camera_transform() shakey = shakey * strength end - lg.translate(ox + shakex, oy + shakey) + lg.translate( + round(ox + shakex), + round(oy + shakey)) end -- cgit v1.3-2-g0d8e