summaryrefslogtreecommitdiffhomepage
path: root/not
diff options
context:
space:
mode:
Diffstat (limited to 'not')
-rw-r--r--not/Hero.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/not/Hero.lua b/not/Hero.lua
index 2549b18..30092bc 100644
--- a/not/Hero.lua
+++ b/not/Hero.lua
@@ -21,6 +21,7 @@ Hero.PUNCH_UP = {-8,-4, -8,-20, 8,-20, 8,-4}
Hero.PUNCH_DOWN = {-8,4, -8,20, 8,20, 8,4}
-- TODO: Portrait managment in Hero and config passed from Menu should be reviewed!
+-- TODO: Clean-up, see `menus/select`.
function Hero:new (config, x, y, world)
local imagePath = config.image
Hero.load()
@@ -46,7 +47,8 @@ function Hero:new (config, x, y, world)
self.isJumping = false
self.spawntimer = 2
self.punchCooldown = 0
- self.portraitQuad = love.graphics.newQuad((config.portrait-1)*28, 0, 28, 27, 1176, 27)
+ -- TODO: Pass loaded portrait from menu to Hero.
+ self.portrait = love.graphics.newImage(config.portrait)
self:setAnimationsList(require("config.animations.hero"))
-- Post-creation
self:createEffect("respawn")
@@ -185,7 +187,7 @@ function Hero:drawHUD (x,y,scale,elevation)
if self.isAlive then
love.graphics.setColor(255,255,255,255)
love.graphics.draw(self.IMAGE_FRAME, self.QUAD_FRAME, (x)*scale, (y)*scale, 0, scale, scale)
- love.graphics.draw(self.IMAGE_PORTRAITS, self.portraitQuad, (x+2)*scale, (y+3)*scale, 0, scale, scale)
+ love.graphics.draw(self.portrait, (x+2)*scale, (y+3)*scale, 0, scale, scale)
local dy = 30 * elevation
love.graphics.setFont(Font)
love.graphics.print((self.combo).."%",(x+2)*scale,(y-3+dy)*scale,0,scale,scale)