From 62b67be7882dffebd6de0c8241d253d806a6905c Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 26 May 2017 19:14:27 +0200 Subject: Halfway through with moving to new OOP module --- not/World.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'not/World.lua') diff --git a/not/World.lua b/not/World.lua index bbceec4..b4ad4fa 100644 --- a/not/World.lua +++ b/not/World.lua @@ -117,13 +117,13 @@ end -- Add new platform to the world -- TODO: it would be nice if function parameters would be same as `not.Platform.new`. function World:createPlatform (x, y, polygon, sprite, animations) - table.insert(self.Platforms, Platform:new(animations, polygon, self, x, y, sprite)) + table.insert(self.Platforms, Platform(animations, polygon, self, x, y, sprite)) end -- Add new naut to the world -- TODO: separate two methods for `not.Hero` and `not.Player`. function World:createNaut (x, y, name) - local naut = Player:new(name, self, x, y) + local naut = Player(name, x, y, self) table.insert(self.Nauts, naut) return naut end @@ -131,14 +131,14 @@ end -- Add new decoration to the world -- TODO: `not.World.create*` functions often have different naming for parameters. It is not ground-breaking but it makes reading code harder for no good reason. function World:createDecoration (x, y, sprite) - table.insert(self.Decorations, Decoration:new(x, y, sprite)) + table.insert(self.Decorations, Decoration(x, y, sprite)) end -- Add new cloud to the world -- TODO: extend variables names to provide better readability. -- TODO: follow new parameters in `not.Cloud.new` based on `not.Cloud.init`. function World:createCloud (x, y, t, v) - table.insert(self.Clouds, Cloud:new(x, y, t, v)) + table.insert(self.Clouds, Cloud(x, y, t, v)) end -- Randomize Cloud creation @@ -165,12 +165,12 @@ end -- TODO: follow new parameters in `not.Effect.new` based on `not.Effect.init`. -- TODO: along with `createRay` move this nearer reast of `create*` methods for readability. function World:createEffect (name, x, y) - table.insert(self.Effects, Effect:new(name, x, y)) + table.insert(self.Effects, Effect(name, x, y)) end -- Add a ray function World:createRay (naut) - table.insert(self.Rays, Ray:new(naut, self)) + table.insert(self.Rays, Ray(naut, self)) end -- get Nauts functions -- cgit v1.1 From 81e72006a4ca0578f0bbc31d0788a6e0223fdb63 Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 26 May 2017 19:53:20 +0200 Subject: Random changed to use love lib --- not/World.lua | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'not/World.lua') diff --git a/not/World.lua b/not/World.lua index b4ad4fa..38639b7 100644 --- a/not/World.lua +++ b/not/World.lua @@ -53,8 +53,6 @@ function World:init (map, nauts) self.Effects = {} self.Decorations = {} self.Rays = {} - -- Random init; TODO: use LOVE2D's random. - math.randomseed(os.time()) -- Map and misc. local map = map or "default" self:loadMap(map) @@ -110,7 +108,7 @@ end -- Get respawn location function World:getSpawnPosition () - local n = math.random(1, #self.map.respawns) + local n = love.math.random(1, #self.map.respawns) return self.map.respawns[n].x, self.map.respawns[n].y end @@ -151,13 +149,13 @@ function World:randomizeCloud (outside) local x,y,t,v local m = self.map if outside then - x = m.center_x-m.width*1.2+math.random(-50,20) + x = m.center_x-m.width*1.2+love.math.random(-50,20) else - x = math.random(m.center_x-m.width/2,m.center_x+m.width/2) + x = love.math.random(m.center_x-m.width/2,m.center_x+m.width/2) end - y = math.random(m.center_y-m.height/2, m.center_y+m.height/2) - t = math.random(1,3) - v = math.random(8,18) + y = love.math.random(m.center_y-m.height/2, m.center_y+m.height/2) + t = love.math.random(1,3) + v = love.math.random(8,18) self:createCloud(x, y, t, v) end -- cgit v1.1 From b14d4608dc921f882067c43c71fcf04db7b2f794 Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 26 May 2017 22:44:00 +0200 Subject: Rest of entities moved to new oop module; tested --- not/World.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'not/World.lua') diff --git a/not/World.lua b/not/World.lua index 38639b7..88be97a 100644 --- a/not/World.lua +++ b/not/World.lua @@ -115,7 +115,7 @@ end -- Add new platform to the world -- TODO: it would be nice if function parameters would be same as `not.Platform.new`. function World:createPlatform (x, y, polygon, sprite, animations) - table.insert(self.Platforms, Platform(animations, polygon, self, x, y, sprite)) + table.insert(self.Platforms, Platform(animations, polygon, x, y, self, sprite)) end -- Add new naut to the world @@ -129,14 +129,14 @@ end -- Add new decoration to the world -- TODO: `not.World.create*` functions often have different naming for parameters. It is not ground-breaking but it makes reading code harder for no good reason. function World:createDecoration (x, y, sprite) - table.insert(self.Decorations, Decoration(x, y, sprite)) + table.insert(self.Decorations, Decoration(x, y, self, sprite)) end -- Add new cloud to the world -- TODO: extend variables names to provide better readability. -- TODO: follow new parameters in `not.Cloud.new` based on `not.Cloud.init`. function World:createCloud (x, y, t, v) - table.insert(self.Clouds, Cloud(x, y, t, v)) + table.insert(self.Clouds, Cloud(x, y, t, v, self)) end -- Randomize Cloud creation @@ -163,7 +163,7 @@ end -- TODO: follow new parameters in `not.Effect.new` based on `not.Effect.init`. -- TODO: along with `createRay` move this nearer reast of `create*` methods for readability. function World:createEffect (name, x, y) - table.insert(self.Effects, Effect(name, x, y)) + table.insert(self.Effects, Effect(name, x, y, self)) end -- Add a ray -- cgit v1.1 From 87f870c0f4eb81e92aee929439692ecc2b95226a Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 26 May 2017 23:05:49 +0200 Subject: World updated to new oop module --- not/World.lua | 53 ++++++++++++++++++++++------------------------------- 1 file changed, 22 insertions(+), 31 deletions(-) (limited to 'not/World.lua') diff --git a/not/World.lua b/not/World.lua index 88be97a..1ced718 100644 --- a/not/World.lua +++ b/not/World.lua @@ -1,29 +1,27 @@ +require "not.Object" + --- `World` -- Used to manage physical world and everything inside it: clouds, platforms, nauts, background etc. -- TODO: Possibly move common parts of `World` and `Menu` to abstract class `Scene`. -World = { - world = --[[love.physics.newWorld]]nil, - Nauts = --[[{not.Hero}]]nil, - Platforms = --[[{not.Platform}]]nil, - Clouds = --[[{not.Cloud}]]nil, - Decorations = --[[{not.Decoration}]]nil, - Effects = --[[{not.Effect}]]nil, - Rays = --[[{not.Ray}]]nil, - camera = --[[not.Camera]]nil, - -- cloud generator - clouds_delay = 5, - -- Map - map = nil, - background = nil, - -- Gameplay status - lastNaut = false, - -- "WINNER" - win_move = 0, - -- Music - music = nil -} +World = Object:extends() -World.__index = World +World.world =--[[love.physics.newWorld]]nil +World.Nauts =--[[{not.Hero}]]nil +World.Platforms =--[[{not.Platform}]]nil +World.Clouds =--[[{not.Cloud}]]nil +World.Decorations =--[[{not.Decoration}]]nil +World.Effects =--[[{not.Effect}]]nil +World.Rays =--[[{not.Ray}]]nil +World.camera =--[[not.Camera]]nil +World.music =--[[not.Music]]nil +-- cloud generator +World.clouds_delay = 5 +-- Map +World.map = nil +World.background = nil +-- Gameplay status +World.lastNaut = false +World.win_move = 0 -- "WINNER" require "not.Platform" require "not.Player" @@ -35,13 +33,6 @@ require "not.Music" -- Constructor of `World` ZA WARUDO! function World:new (map, nauts) - local o = setmetatable({}, self) - o:init(map, nauts) - return o -end - --- Init za warudo -function World:init (map, nauts) -- Box2D physical world. love.physics.setMeter(64) self.world = love.physics.newWorld(0, 9.81*64, true) @@ -401,9 +392,9 @@ function World:controlpressed (set, action, key) local map = self:getMapName() local nauts = {} for _,naut in pairs(self:getNautsAll()) do - table.insert(nauts, {naut.name, naut:getControlSet()}) + table.insert(nauts, {naut.name, naut:getControllerSet()}) end - local new = World:new(map, nauts) + local new = World(map, nauts) changeScene(new) end for k,naut in pairs(self:getNautsAll()) do -- cgit v1.1 From 20190e7e7878c9217dc2633cbb912e405c19074f Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 15 Jun 2017 14:57:58 +0200 Subject: Pushing old edits World comments and main newline a eof --- not/World.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'not/World.lua') diff --git a/not/World.lua b/not/World.lua index 1ced718..99f50fa 100644 --- a/not/World.lua +++ b/not/World.lua @@ -14,12 +14,9 @@ World.Effects =--[[{not.Effect}]]nil World.Rays =--[[{not.Ray}]]nil World.camera =--[[not.Camera]]nil World.music =--[[not.Music]]nil --- cloud generator World.clouds_delay = 5 --- Map -World.map = nil -World.background = nil --- Gameplay status +World.map =--[[config.maps.*]]nil +World.background =--[[image?]]nil World.lastNaut = false World.win_move = 0 -- "WINNER" -- cgit v1.1 From ae8ce1a11ca02297ff9fe05b3146c620a2485975 Mon Sep 17 00:00:00 2001 From: Aki Date: Tue, 27 Jun 2017 09:05:16 +0200 Subject: Scenes now use MusicPlayer --- not/World.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'not/World.lua') diff --git a/not/World.lua b/not/World.lua index 99f50fa..112846a 100644 --- a/not/World.lua +++ b/not/World.lua @@ -26,7 +26,7 @@ require "not.Cloud" require "not.Effect" require "not.Decoration" require "not.Ray" -require "not.Music" +require "not.MusicPlayer" -- Constructor of `World` ZA WARUDO! function World:new (map, nauts) @@ -46,7 +46,7 @@ function World:new (map, nauts) self:loadMap(map) self:spawnNauts(nauts) self.camera = Camera:new(self) - self.music = Music:new(self.map.theme) + self.music = MusicPlayer(self.map.theme) end -- The end of the world @@ -402,4 +402,4 @@ function World:controlreleased (set, action, key) for k,naut in pairs(self:getNautsAll()) do naut:controlreleased(set, action, key) end -end \ No newline at end of file +end -- cgit v1.1 From 47d4e1c229adfffb70b3c984d00049bcebcfc183 Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 12 Jul 2017 09:04:23 +0200 Subject: All music playing moved to single instance of MusicPlayer --- not/World.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'not/World.lua') diff --git a/not/World.lua b/not/World.lua index 112846a..ab94ff4 100644 --- a/not/World.lua +++ b/not/World.lua @@ -26,7 +26,6 @@ require "not.Cloud" require "not.Effect" require "not.Decoration" require "not.Ray" -require "not.MusicPlayer" -- Constructor of `World` ZA WARUDO! function World:new (map, nauts) @@ -46,7 +45,8 @@ function World:new (map, nauts) self:loadMap(map) self:spawnNauts(nauts) self.camera = Camera:new(self) - self.music = MusicPlayer(self.map.theme) + musicPlayer:setTrack(self.map.theme) + musicPlayer:play() end -- The end of the world @@ -57,7 +57,6 @@ function World:delete () for _,naut in pairs(self.Nauts) do naut:delete() end - self.music:delete() self.world:destroy() end -- cgit v1.1 From d161510d2dc33046459e874e716c02c76d49f7d5 Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 12 Jul 2017 09:38:36 +0200 Subject: Menu moved to new OOP model --- not/World.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'not/World.lua') diff --git a/not/World.lua b/not/World.lua index ab94ff4..be29557 100644 --- a/not/World.lua +++ b/not/World.lua @@ -195,7 +195,7 @@ function World:onNautKilled (naut) self:createRay(naut) local nauts = self:getNautsPlayable() if self.lastNaut then - changeScene(Menu:new()) + changeScene(Menu()) elseif #nauts < 2 then self.lastNaut = true naut:playSound(5, true) -- cgit v1.1 From 6c6e2fe6ec84ec57f6336fa9d6e4136c0e1c9513 Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 12 Jul 2017 11:09:05 +0200 Subject: All changeScene calls replaced with proper SceneManager calls --- not/World.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'not/World.lua') diff --git a/not/World.lua b/not/World.lua index be29557..8108a8a 100644 --- a/not/World.lua +++ b/not/World.lua @@ -195,7 +195,7 @@ function World:onNautKilled (naut) self:createRay(naut) local nauts = self:getNautsPlayable() if self.lastNaut then - changeScene(Menu()) + sceneManager:changeScene(Menu()) elseif #nauts < 2 then self.lastNaut = true naut:playSound(5, true) @@ -391,7 +391,7 @@ function World:controlpressed (set, action, key) table.insert(nauts, {naut.name, naut:getControllerSet()}) end local new = World(map, nauts) - changeScene(new) + sceneManager:changeScene(new) end for k,naut in pairs(self:getNautsAll()) do naut:controlpressed(set, action, key) -- cgit v1.1 From 9af261cd204b999e6b2b5a44d5c5eb768f84c49d Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 12 Jul 2017 16:00:51 +0200 Subject: Created Scene class extended SceneManager a little bit to support multiple scenes --- not/World.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'not/World.lua') diff --git a/not/World.lua b/not/World.lua index 8108a8a..65ca59e 100644 --- a/not/World.lua +++ b/not/World.lua @@ -1,9 +1,7 @@ -require "not.Object" - --- `World` -- Used to manage physical world and everything inside it: clouds, platforms, nauts, background etc. -- TODO: Possibly move common parts of `World` and `Menu` to abstract class `Scene`. -World = Object:extends() +World = require "not.Scene":extends() World.world =--[[love.physics.newWorld]]nil World.Nauts =--[[{not.Hero}]]nil -- cgit v1.1 From 1aa2ddfd920899e61295d876f3433dcab6dd6ed8 Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 15 Jul 2017 01:21:01 +0200 Subject: Win screen is now handled by Scene Issue with MusicPlayer calls in Scene constructor (not solved) --- not/World.lua | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) (limited to 'not/World.lua') diff --git a/not/World.lua b/not/World.lua index 65ca59e..29c46cc 100644 --- a/not/World.lua +++ b/not/World.lua @@ -16,7 +16,6 @@ World.clouds_delay = 5 World.map =--[[config.maps.*]]nil World.background =--[[image?]]nil World.lastNaut = false -World.win_move = 0 -- "WINNER" require "not.Platform" require "not.Player" @@ -193,18 +192,15 @@ function World:onNautKilled (naut) self:createRay(naut) local nauts = self:getNautsPlayable() if self.lastNaut then + sceneManager:removeTopScene() sceneManager:changeScene(Menu()) elseif #nauts < 2 then self.lastNaut = true naut:playSound(5, true) + sceneManager:addScene(Menu("win")) end end -function World:getBounce (f) - local f = f or 1 - return math.sin(self.win_move*f*math.pi) -end - -- LÖVE2D callbacks -- Update ZU WARUDO function World:update (dt) @@ -250,11 +246,6 @@ function World:update (dt) table.remove(self.Rays, _) end end - -- Bounce `winner` - self.win_move = self.win_move + dt - if self.win_move > 2 then - self.win_move = self.win_move - 2 - end end -- Draw function World:draw () @@ -333,17 +324,6 @@ function World:draw () if _ < 3 then y, e = h-33, 0 end naut:drawHUD(1+(_%2)*(w-34), y, scale, e) end - - -- Draw winner - if self.lastNaut then - local w, h = love.graphics.getWidth()/scale, love.graphics.getHeight()/scale - local angle = self:getBounce(2) - local dy = self:getBounce()*3 - love.graphics.setFont(Bold) - love.graphics.printf("WINNER",(w/2)*scale,(42+dy)*scale,336,"center",(angle*5)*math.pi/180,scale,scale,168,12) - love.graphics.setFont(Font) - love.graphics.printf("rofl, now kill yourself", w/2*scale, 18*scale, 160, "center", 0, scale, scale, 80, 3) - end end -- Box2D callbacks -- cgit v1.1 From 73bca2d56b9a95b6b233da8ac466ba1d1f081c76 Mon Sep 17 00:00:00 2001 From: Aki Date: Sun, 16 Jul 2017 17:20:03 +0200 Subject: Pause works now MusicPlayer bug still exists for pause and win screens --- not/World.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'not/World.lua') diff --git a/not/World.lua b/not/World.lua index 29c46cc..c6b74a3 100644 --- a/not/World.lua +++ b/not/World.lua @@ -371,6 +371,11 @@ function World:controlpressed (set, action, key) local new = World(map, nauts) sceneManager:changeScene(new) end + if key == "escape" then + sceneManager:addScene(Menu("pause")) + self:setInputDisabled(true) + self:setSleeping(true) + end for k,naut in pairs(self:getNautsAll()) do naut:controlpressed(set, action, key) end -- cgit v1.1 From fc43bcb81b5dbfc8ef8dd164193014aa0cf43c9f Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 17 Jul 2017 12:53:00 +0200 Subject: Trail now works mostly as intended --- not/World.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'not/World.lua') diff --git a/not/World.lua b/not/World.lua index c6b74a3..3a5b051 100644 --- a/not/World.lua +++ b/not/World.lua @@ -337,6 +337,7 @@ function World.beginContact (a, b, coll) b:getUserData().inAir = false b:getUserData().jumpCounter = 2 b:getUserData().salto = false + b:getUserData().smoke = false b:getUserData():createEffect("land") end local vx, vy = b:getUserData().body:getLinearVelocity() -- cgit v1.1 From 7ad366dcec68c703499e3f6f72b345d1adeac1da Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 17 Jul 2017 14:15:36 +0200 Subject: Moved landing method to Hero from World --- not/World.lua | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'not/World.lua') diff --git a/not/World.lua b/not/World.lua index 3a5b051..47a1237 100644 --- a/not/World.lua +++ b/not/World.lua @@ -332,13 +332,7 @@ function World.beginContact (a, b, coll) if a:getCategory() == 1 then local x,y = coll:getNormal() if y < -0.6 then - -- TODO: move landing to `not.Hero` - -- Move them to Hero - b:getUserData().inAir = false - b:getUserData().jumpCounter = 2 - b:getUserData().salto = false - b:getUserData().smoke = false - b:getUserData():createEffect("land") + b:getUserData():land() end local vx, vy = b:getUserData().body:getLinearVelocity() if math.abs(x) == 1 or (y < -0.6 and x == 0) then -- cgit v1.1 From 657eb912abc89a71d16ea60516458ad6c72f6a4e Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 19 Jul 2017 14:50:25 +0200 Subject: Initial clash No additional effect, rusty mechanics for now --- not/World.lua | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'not/World.lua') diff --git a/not/World.lua b/not/World.lua index 47a1237..92b71ea 100644 --- a/not/World.lua +++ b/not/World.lua @@ -329,6 +329,10 @@ end -- Box2D callbacks -- beginContact function World.beginContact (a, b, coll) + -- TODO: Stop using magical numbers: + -- [1] -> Platform + -- [2] -> Hero + -- [3] -> Punch sensor if a:getCategory() == 1 then local x,y = coll:getNormal() if y < -0.6 then @@ -340,10 +344,18 @@ function World.beginContact (a, b, coll) end end if a:getCategory() == 3 then - b:getUserData():damage(a:getUserData()[2]) + if b:getCategory() == 2 then + b:getUserData():damage(a:getUserData()[2]) + end + if b:getCategory() == 3 then + a:getBody():getUserData():damage(b:getUserData()[2]) + b:getBody():getUserData():damage(a:getUserData()[2]) + end end if b:getCategory() == 3 then - a:getUserData():damage(b:getUserData()[2]) + if a:getCategory() == 2 then + a:getUserData():damage(b:getUserData()[2]) + end end end -- endContact -- cgit v1.1 From 53e8d75edc401d613a1fee9795532cc6d98f7132 Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 19 Jul 2017 15:12:10 +0200 Subject: Added clash effect for clashes --- not/World.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'not/World.lua') diff --git a/not/World.lua b/not/World.lua index 92b71ea..992eef8 100644 --- a/not/World.lua +++ b/not/World.lua @@ -350,6 +350,11 @@ function World.beginContact (a, b, coll) if b:getCategory() == 3 then a:getBody():getUserData():damage(b:getUserData()[2]) b:getBody():getUserData():damage(a:getUserData()[2]) + local x1,y1 = b:getBody():getUserData():getPosition() + local x2,y2 = a:getBody():getUserData():getPosition() + local x = (x2 - x1) / 2 + x1 - 12 + local y = (y2 - y1) / 2 + y1 - 15 + a:getBody():getUserData().world:createEffect("clash", x, y) end end if b:getCategory() == 3 then -- cgit v1.1 From ca6b363b70117198266022316a4ebfc9c8d1cda8 Mon Sep 17 00:00:00 2001 From: Aki Date: Wed, 19 Jul 2017 15:14:32 +0200 Subject: Cleaned-up Contact functions --- not/World.lua | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'not/World.lua') diff --git a/not/World.lua b/not/World.lua index 992eef8..86b1560 100644 --- a/not/World.lua +++ b/not/World.lua @@ -327,12 +327,13 @@ function World:draw () end -- Box2D callbacks --- beginContact +-- TODO: Rather than here, these contacts should be in `Hero` (most likely). +-- TODO: Explode these into more functions.\ +-- TODO: Stop using magical numbers: +-- [1] -> Platform +-- [2] -> Hero +-- [3] -> Punch sensor function World.beginContact (a, b, coll) - -- TODO: Stop using magical numbers: - -- [1] -> Platform - -- [2] -> Hero - -- [3] -> Punch sensor if a:getCategory() == 1 then local x,y = coll:getNormal() if y < -0.6 then @@ -363,10 +364,8 @@ function World.beginContact (a, b, coll) end end end --- endContact function World.endContact (a, b, coll) if a:getCategory() == 1 then - -- Move them to Hero b:getUserData().inAir = true end end -- cgit v1.1 From 02aba07e03465205b45c41df7aec6894d4e89909 Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 20 Jul 2017 19:51:30 +0200 Subject: Moved name-tag drawing to separate function; moved up overall in drawing functions --- not/World.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'not/World.lua') diff --git a/not/World.lua b/not/World.lua index 86b1560..7317617 100644 --- a/not/World.lua +++ b/not/World.lua @@ -315,6 +315,10 @@ function World:draw () love.graphics.line(x1,y1,x2,y2) end + for _,naut in pairs(self.Nauts) do + naut:drawTag(offset_x, offset_y, scale) + end + -- Draw HUDs for _,naut in pairs(self.Nauts) do -- I have no idea where to place them T_T -- cgit v1.1 From 9aa820bf100845da2024bf3af9e802c90b3a6b51 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 31 Jul 2017 22:20:41 +0200 Subject: Fixed scaling issues on display change --- not/World.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'not/World.lua') diff --git a/not/World.lua b/not/World.lua index 7317617..c73a3da 100644 --- a/not/World.lua +++ b/not/World.lua @@ -251,8 +251,8 @@ end function World:draw () -- Camera stuff local offset_x, offset_y = self.camera:getOffsets() - local scale = self.camera.scale - local scaler = self.camera.scaler + local scale = getScale() + local scaler = getRealScale() -- Background love.graphics.draw(self.background, 0, 0, 0, scaler, scaler) -- cgit v1.1