summaryrefslogtreecommitdiffhomepage
path: root/not/World.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-09-11 06:17:29 +0200
committerAki <nthirtyone@gmail.com>2017-09-11 06:17:29 +0200
commit9ddacd0f6481661cdaeab8abf2000b45a296faee (patch)
treea3e072e2861d911c59c96267b2a0f0272efc6c79 /not/World.lua
parent9e2ec1aa5abb84d3e46c34ed407934ac54fce331 (diff)
downloadroflnauts-9ddacd0f6481661cdaeab8abf2000b45a296faee.zip
roflnauts-9ddacd0f6481661cdaeab8abf2000b45a296faee.tar.gz
roflnauts-9ddacd0f6481661cdaeab8abf2000b45a296faee.tar.bz2
Camera methods have some funky names. New following implementation
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)