New lighting!

This commit is contained in:
lustlion
2021-10-27 11:06:08 +02:00
parent 5e1148f49d
commit 538a1f77f8
11 changed files with 158 additions and 91 deletions

View File

@@ -5,11 +5,11 @@ Camera = {
}
function Camera:CenterAt(x,y,cx,cy)
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
self.pos.x = x-self.width/game.scale/2
self.pos.y = y-self.height/game.scale/2
if not (cx == nil or cy == nil) then
cx = cx - self.width
cy = cy - self.height
if self.pos.x > cx then self.pos.x = cx end
if self.pos.y > cy then self.pos.y = cy end
if self.pos.x < 0 then self.pos.x = 0 end