From 16c1140ead99064799113eb3d8ddcf47929bba70 Mon Sep 17 00:00:00 2001 From: Elizabeth Alexander Hunt Date: Thu, 28 May 2026 21:01:02 -0700 Subject: Adding debug collision boxes, making bullets hurt you, and be able to kill bullets upon consumption --- camera.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'camera.lua') 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 -- cgit v1.3