diff options
| author | Elizabeth Alexander Hunt <me@liz.coffee> | 2026-05-09 18:38:21 -0700 |
|---|---|---|
| committer | Elizabeth Alexander Hunt <me@liz.coffee> | 2026-05-09 18:38:21 -0700 |
| commit | eb9466c8d3d18d65eb4bab2f6770f55cba9d8de3 (patch) | |
| tree | bd2c49b56d9a4bdc30e3aec5ad0b3139b398c566 /entity.lua | |
| parent | 78fd742b1e276aec3eb1e939542ef51c3231b060 (diff) | |
| download | dyl8-eb9466c8d3d18d65eb4bab2f6770f55cba9d8de3.tar.gz dyl8-eb9466c8d3d18d65eb4bab2f6770f55cba9d8de3.zip | |
Adding a simple grid-based camera
Diffstat (limited to 'entity.lua')
| -rw-r--r-- | entity.lua | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -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 ) |
