summaryrefslogtreecommitdiffhomepage
path: root/not/World.lua
diff options
context:
space:
mode:
Diffstat (limited to 'not/World.lua')
-rw-r--r--not/World.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/not/World.lua b/not/World.lua
index 6aee966..aeed245 100644
--- a/not/World.lua
+++ b/not/World.lua
@@ -37,7 +37,7 @@ function World:new (map, nauts)
self:initClouds()
self:spawnNauts(nauts)
- self.camera = Camera(self)
+ self.camera = Camera(self.map.center.x, self.map.center.y, self)
musicPlayer:play(self.map.theme)
end
@@ -203,6 +203,7 @@ end
function World:update (dt)
self.world:update(dt)
self.camera:update(dt)
+ self.camera:sum(self.map.center.x, self.map.center.y)
if self.cloudGenerator then
self.cloudGenerator:update(dt)
@@ -214,6 +215,11 @@ function World:update (dt)
end
end
+ -- TODO: Weird Camera following Heroes.
+ for _,hero in pairs(self:getNautsAll()) do
+ self.camera:sum(hero:getPosition())
+ end
+
-- Some additional debug info.
local stats = love.graphics.getStats()
dbg_msg = string.format("%sMap: %s\nClouds: %d\nLoaded: %d\nMB: %.2f", dbg_msg, self.map.filename, self:getCloudsCount(), stats.images, stats.texturememory / 1024 / 1024)