diff options
author | Aki <nthirtyone@gmail.com> | 2017-09-05 19:13:45 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2017-09-05 19:13:45 +0200 |
commit | de86586e3957be9e0794698e86ce913adc91beea (patch) | |
tree | 9e107cdca02714545a977f9dbfc074313d7d4458 /not/World.lua | |
parent | 1ffc08dd2343b76b2f94d9c290ef346346585270 (diff) | |
download | roflnauts-de86586e3957be9e0794698e86ce913adc91beea.zip roflnauts-de86586e3957be9e0794698e86ce913adc91beea.tar.gz roflnauts-de86586e3957be9e0794698e86ce913adc91beea.tar.bz2 |
That background kept irritating me. Background now follows offset with ratio
Diffstat (limited to 'not/World.lua')
-rw-r--r-- | not/World.lua | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/not/World.lua b/not/World.lua index b97a5b5..097b21a 100644 --- a/not/World.lua +++ b/not/World.lua @@ -61,9 +61,8 @@ function World:buildMap () end if op.background then local image = love.graphics.newImage(op.background) - local x = self.map.center.x - (image:getWidth() / 2) - local y = self.map.center.y - (image:getHeight() / 2) - self:createDecoration(x, y, op.background) -- TODO: Decoration does not allow Image instead of filePath! + local bg = self:createDecoration(0, 0, op.background) -- TODO: Decoration does not allow Image instead of filePath! + bg.ratio = op.ratio end end end @@ -102,7 +101,9 @@ function World:createNaut (x, y, name) end function World:createDecoration (x, y, sprite) - table.insert(self.Decorations, Decoration(x, y, self, sprite)) + local deco = Decoration(x, y, self, sprite) + table.insert(self.Decorations, deco) + return deco end function World:createEffect (name, x, y) @@ -175,7 +176,7 @@ end function World:update (dt) self.world:update(dt) self.camera:update(dt) - + if self.cloudGenerator then self.cloudGenerator:update(dt) end |