summaryrefslogtreecommitdiff
path: root/camera.lua
diff options
context:
space:
mode:
Diffstat (limited to 'camera.lua')
-rw-r--r--camera.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/camera.lua b/camera.lua
index 6062ee7..bb69183 100644
--- a/camera.lua
+++ b/camera.lua
@@ -42,6 +42,12 @@ end
_cull_factor = 1/4
function Camera:render(entity)
screen_position = (entity.sprite_position or entity.position) - self.position
+ if DEBUG and entity.collision then
+ entity_collision_box = { top_left = screen_position + entity.collision_bounds.top_left, bottom_right = screen_position + entity.collision_bounds.bottom_right }
+ -- entity_collision_box = { top_left = screen_position, bottom_right = screen_position + vec2(8, 8)}
+ -- entity_collision_box = entity_collision_bounds
+ rect(entity_collision_box.top_left.x, entity_collision_box.top_left.y, entity_collision_box.bottom_right.x, entity_collision_box.bottom_right.y, 5)
+ end
if screen_position:in_bounds(SCREEN * -_cull_factor, SCREEN * (1 + _cull_factor)) then
entity:render(screen_position)
end