summaryrefslogtreecommitdiffhomepage
path: root/player.lua
diff options
context:
space:
mode:
Diffstat (limited to 'player.lua')
-rw-r--r--player.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/player.lua b/player.lua
index bb30f21..abaf37d 100644
--- a/player.lua
+++ b/player.lua
@@ -271,8 +271,13 @@ function Player:draw (offset_x, offset_y, scale, debug)
end
-- Draw HUD of `Player`
-function Player:drawHUD (x,y,scale)
+-- elevation: 1 bottom, 0 top
+function Player:drawHUD (x,y,scale,elevation)
+ love.graphics.setColor(255,255,255,255)
love.graphics.draw(self.portrait_sprite, self.portrait_sheet[self.name].normal, x*scale, y*scale, 0, scale, scale)
+ local dy = 30 * elevation
+ love.graphics.print(self.combo.."0x",(x+2)*scale,(y-3+dy)*scale,0,scale,scale)
+ love.graphics.print(math.max(0, self.lives),(x+24)*scale,(y-3+dy)*scale,0,scale,scale)
end
-- Change animation of `Player`