diff options
author | Aki <nthirtyone@gmail.com> | 2017-09-13 04:40:40 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2017-09-13 04:40:40 +0200 |
commit | a0bbf9f36db30b0c6de3480f525ee69698ba18f9 (patch) | |
tree | c0347c55c10b1cad8640aa788e154715da174e64 /not/CloudGenerator.lua | |
parent | ed16d208863944f64ce42298132597345cb749bb (diff) | |
download | roflnauts-a0bbf9f36db30b0c6de3480f525ee69698ba18f9.zip roflnauts-a0bbf9f36db30b0c6de3480f525ee69698ba18f9.tar.gz roflnauts-a0bbf9f36db30b0c6de3480f525ee69698ba18f9.tar.bz2 |
> inb4 Multiple generators
CloudGenerator now counts only clouds spawned by itself
Diffstat (limited to 'not/CloudGenerator.lua')
-rw-r--r-- | not/CloudGenerator.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/not/CloudGenerator.lua b/not/CloudGenerator.lua index e9d8ed7..36ec70f 100644 --- a/not/CloudGenerator.lua +++ b/not/CloudGenerator.lua @@ -20,6 +20,7 @@ function CloudGenerator:createCloud (x, y, style) cloud:setAnimation(style) cloud:setVelocity(13, 0) cloud:setBoundary(340, 320) + cloud.generator = self return cloud end @@ -55,7 +56,7 @@ function CloudGenerator:run (count, inside) end function CloudGenerator:update (dt) - local count = self.world:getCloudsCount() + local count = self.world:getCloudsCountFrom(self) if self.timer < 0 and self.count > count then self.timer = self.timer + self.interval self:run() |