summaryrefslogtreecommitdiffhomepage
path: root/not
diff options
context:
space:
mode:
Diffstat (limited to 'not')
-rw-r--r--not/World.lua15
1 files changed, 3 insertions, 12 deletions
diff --git a/not/World.lua b/not/World.lua
index 2a7437f..5d46b5b 100644
--- a/not/World.lua
+++ b/not/World.lua
@@ -24,7 +24,6 @@ function World:new (map, nauts)
self:initLayers()
self:buildMap()
- self:initClouds()
self:spawnNauts(nauts)
self.camera = Camera(self.map.center.x, self.map.center.y, self)
@@ -97,13 +96,9 @@ function World:buildMap ()
end
bg.layer = self:addLayer(width, height, op.ratio)
end
- end
-end
-
-function World:initClouds ()
- if self.map.clouds then
- self.cloudGenerator = CloudGenerator(self)
- self.cloudGenerator:run(6, true)
+ if op.clouds then
+ self:insertEntity(CloudGenerator(self)):run(6, true)
+ end
end
end
@@ -265,10 +260,6 @@ function World:update (dt)
self.world:update(dt)
self.camera:update(dt)
- if self.cloudGenerator then
- self.cloudGenerator:update(dt)
- end
-
for key,entity in pairs(self.entities) do
if entity:update(dt) then
table.remove(self.entities, key):delete()