From 6cef97b6e9ba6878607b1fff08e42ca19b79914f Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 7 Apr 2018 18:53:31 +0200 Subject: Hopefully all uses of setColor now use values in <0,1> range --- not/Hero.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'not/Hero.lua') diff --git a/not/Hero.lua b/not/Hero.lua index a97a2b1..14e32f1 100644 --- a/not/Hero.lua +++ b/not/Hero.lua @@ -175,7 +175,7 @@ end function Hero:drawTag () local x,y = self:getPosition() love.graphics.setFont(Font) - love.graphics.setColor(255, 255, 255) + love.graphics.setColor(1, 1, 1) love.graphics.printf(string.format("Player %d", math.abs(self.group)), math.floor(x), math.floor(y)-26 ,100,'center',0,1,1,50,0) end @@ -184,7 +184,7 @@ end function Hero:drawHUD (x,y,scale,elevation) -- hud displays only if player is alive if self.isAlive then - love.graphics.setColor(255,255,255,255) + love.graphics.setColor(1, 1, 1, 1) love.graphics.draw(self.IMAGE_FRAME, self.QUAD_FRAME, (x)*scale, (y)*scale, 0, scale, scale) love.graphics.draw(self.portrait, (x+2)*scale, (y+3)*scale, 0, scale, scale) local dy = 30 * elevation -- cgit v1.1 From 6c487d44312dd96fb37825ea3fc7354f108fdfb6 Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 7 Apr 2018 19:10:14 +0200 Subject: Now uses getFixtures instead of deprecated getFixtureList --- not/Hero.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'not/Hero.lua') diff --git a/not/Hero.lua b/not/Hero.lua index 14e32f1..3037837 100644 --- a/not/Hero.lua +++ b/not/Hero.lua @@ -114,7 +114,7 @@ function Hero:update (dt) -- Cooldown self.punchCooldown = self.punchCooldown - dt if not self.body:isDestroyed() then -- TODO: This is weird - for _,fixture in pairs(self.body:getFixtureList()) do -- TODO: getFixtures from `PhysicalBody` or similar. + for _,fixture in pairs(self.body:getFixtures()) do -- TODO: getFixtures from `PhysicalBody` or similar. if fixture:getUserData() ~= self then fixture:setUserData({fixture:getUserData()[1] - dt, fixture:getUserData()[2]}) if fixture:getUserData()[1] < 0 then -- cgit v1.1 From 290d75dceb905217cb67fcb32e95dbeb45e27e3c Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 7 Apr 2018 19:23:14 +0200 Subject: Renamed setAnimationsList to setAnimations to follow love's naming convention --- not/Hero.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'not/Hero.lua') diff --git a/not/Hero.lua b/not/Hero.lua index 3037837..2b5c529 100644 --- a/not/Hero.lua +++ b/not/Hero.lua @@ -49,7 +49,7 @@ function Hero:new (config, x, y, world) self.punchCooldown = 0 -- TODO: Pass loaded portrait from menu to Hero. self.portrait = love.graphics.newImage(config.portrait) - self:setAnimationsList(require("config.animations.hero")) + self:setAnimations(require("config.animations.hero")) -- Post-creation self:createEffect("respawn") end -- cgit v1.1