Moved game loop from main.lua to specific script, sliced it into parts
This commit is contained in:
@@ -4,7 +4,7 @@ Camera = {
|
||||
height = 0
|
||||
}
|
||||
|
||||
function Camera:CenterAt(x,y,cx,cy)
|
||||
function Camera:positionCenterAt(x,y,cx,cy)
|
||||
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
|
||||
@@ -19,7 +19,7 @@ function Camera:CenterAt(x,y,cx,cy)
|
||||
self.pos.y = math.floor(self.pos.y)
|
||||
end
|
||||
|
||||
function Camera:ScreenAt(x,y)
|
||||
function Camera:positionAt(x,y)
|
||||
self.pos.x = math.floor(x/self.width)*self.width
|
||||
self.pos.y = math.floor(y/self.height)*self.height
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user