naming convention for most stuff but not all

This commit is contained in:
lustlion
2022-03-04 23:28:30 +01:00
parent c978855711
commit cef2096577
29 changed files with 354 additions and 436 deletions

View File

@@ -9,7 +9,7 @@ function Camera:followPlayer(player)
local room = player:getCollidingAt(pos.x,pos.y,LoadedObjects.Rooms)
self:positionCenterAt(pos.x, pos.y)
self:confineTo(room)
end
@@ -19,10 +19,10 @@ function Camera:confineTo(box)
return
end
--frameDebug("in a room")
local w = self.width/game.scale
local h = self.height/game.scale
-- bottom edge
self.pos.y = math.min(self.pos.y+h, box.to.y)-h
-- right edge
@@ -33,7 +33,7 @@ function Camera:confineTo(box)
self.pos.x = math.max(self.pos.x, box.from.x)
end
function Camera:ConfineToLevel()
function Camera:confineToLevel()
self.pos.x = math.max(0,math.min(self.pos.x,LevelData.Width-self.width/game.scale))
self.pos.y = math.max(0,math.min(self.pos.y,LevelData.Height-self.height/game.scale))
end