From 5e1148f49de2084043dcb13edd0b567b09d417c3 Mon Sep 17 00:00:00 2001 From: lustlion Date: Tue, 26 Oct 2021 15:03:31 +0200 Subject: [PATCH] cleaning --- LoreMuseum | 1 - data/scripts/camera.lua | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) delete mode 160000 LoreMuseum diff --git a/LoreMuseum b/LoreMuseum deleted file mode 160000 index 38e8c5a..0000000 --- a/LoreMuseum +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 38e8c5a4db22269d5d63d39c733b3802452b4c0b diff --git a/data/scripts/camera.lua b/data/scripts/camera.lua index c5c14fb..aba633e 100644 --- a/data/scripts/camera.lua +++ b/data/scripts/camera.lua @@ -5,13 +5,15 @@ Camera = { } function Camera:CenterAt(x,y,cx,cy) - self.pos.x = x-self.width/2 - self.pos.y = y-self.height/2 + self.pos.x = x-self.width/(2*game.scale) + self.pos.y = y-self.height/(2*game.scale) + cx = cx - self.width + cy = cy - self.height if not (cx == nil or cy == nil) then - if self.pos.x < 0 then self.pos.x = 0 end if self.pos.x > cx then self.pos.x = cx end - if self.pos.y < 0 then self.pos.y = 0 end if self.pos.y > cy then self.pos.y = cy end + if self.pos.x < 0 then self.pos.x = 0 end + if self.pos.y < 0 then self.pos.y = 0 end end self.pos.x = math.floor(self.pos.x) self.pos.y = math.floor(self.pos.y)