From eb9466c8d3d18d65eb4bab2f6770f55cba9d8de3 Mon Sep 17 00:00:00 2001 From: Elizabeth Alexander Hunt Date: Sat, 9 May 2026 18:38:21 -0700 Subject: Adding a simple grid-based camera --- entity.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'entity.lua') diff --git a/entity.lua b/entity.lua index 54c9769..2758071 100644 --- a/entity.lua +++ b/entity.lua @@ -172,9 +172,7 @@ function _get_animation_key(line_of_sight) return _animation_keys[n_line_of_sight.x + 2] .. "_x" end -function Entity:render() - pos = self.sprite_position or self.position - +function Entity:render(screen_position) animation = self.states[self.state].animation if (animation == nil) then return end if (self.line_of_sight ~= nil) then @@ -190,7 +188,7 @@ function Entity:render() reflection = animation.reflect or vec2(false, false) spr( frame, - self.sprite_position.x, self.sprite_position.y, + screen_position.x, screen_position.y, 1, 1, reflection.x, reflection.y ) -- cgit v1.3