summaryrefslogtreecommitdiff
path: root/camera.lua
diff options
context:
space:
mode:
authorElizabeth Alexander Hunt <me@liz.coffee>2026-05-16 08:10:20 -0700
committerElizabeth Alexander Hunt <me@liz.coffee>2026-05-16 08:10:20 -0700
commit7d415c4958f584c031922ed77a3559d15bf2dc1b (patch)
tree1957ccc8a42de22778b639352b38d9091a4adf4d /camera.lua
parent8cd9ec2e98d27b414bc7cff3a5a98b0aad9099ce (diff)
downloaddyl8-7d415c4958f584c031922ed77a3559d15bf2dc1b.tar.gz
dyl8-7d415c4958f584c031922ed77a3559d15bf2dc1b.zip
Snapshot
Diffstat (limited to 'camera.lua')
-rw-r--r--camera.lua6
1 files changed, 2 insertions, 4 deletions
diff --git a/camera.lua b/camera.lua
index b2dcf4c..6062ee7 100644
--- a/camera.lua
+++ b/camera.lua
@@ -42,11 +42,9 @@ end
_cull_factor = 1/4
function Camera:render(entity)
screen_position = (entity.sprite_position or entity.position) - self.position
- if not screen_position:in_bounds(SCREEN * -_cull_factor, SCREEN * (1 + _cull_factor)) then
- return
+ if screen_position:in_bounds(SCREEN * -_cull_factor, SCREEN * (1 + _cull_factor)) then
+ entity:render(screen_position)
end
-
- entity:render(screen_position)
end
function Camera:new(tracking)