From 482797c1feab2b238822202593c1964c648d4198 Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 21 May 2016 20:35:47 +0200 Subject: HUD combo/lives --- player.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'player.lua') 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` -- cgit v1.1