naming convention for most stuff but not all
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user