diff options
| author | Elizabeth Alexander Hunt <me@liz.coffee> | 2026-05-28 21:01:02 -0700 |
|---|---|---|
| committer | Elizabeth Alexander Hunt <me@liz.coffee> | 2026-05-28 21:01:02 -0700 |
| commit | 16c1140ead99064799113eb3d8ddcf47929bba70 (patch) | |
| tree | 39222a2af7491afaf0efd7fa9b5771d0283c78cc /camera.lua | |
| parent | 661156ce988131eb4896a7af4d00a42b520305e7 (diff) | |
| download | dyl8-16c1140ead99064799113eb3d8ddcf47929bba70.tar.gz dyl8-16c1140ead99064799113eb3d8ddcf47929bba70.zip | |
Adding debug collision boxes, making bullets hurt you, and be able to kill bullets upon consumptionHEADmain
Diffstat (limited to 'camera.lua')
| -rw-r--r-- | camera.lua | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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 |
