diff options
| author | ne_mene <[email protected]> | 2026-04-07 23:38:39 +0200 |
|---|---|---|
| committer | ne_mene <[email protected]> | 2026-04-07 23:38:39 +0200 |
| commit | b4d4e4bd6c25655dd0f7bd5f6b377a74429bf012 (patch) | |
| tree | 930fb67e897b475c16618302657f87c43ea9663e /src | |
| parent | 6bf272a5d79e82532ffe48bd8257cb0a0852be73 (diff) | |
fixed camera shake rounding
Diffstat (limited to 'src')
| -rw-r--r-- | src/camera.lua | 8 |
1 files changed, 5 insertions, 3 deletions
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 |
