summaryrefslogtreecommitdiffhomepage
path: root/player.lua
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2016-05-21 20:35:47 +0200
committerAki <nthirtyone@gmail.com>2016-05-21 20:35:47 +0200
commit482797c1feab2b238822202593c1964c648d4198 (patch)
tree0fbbeb1301ad8422090858ffc49abea7142c2f07 /player.lua
parent4b63616195fd1910b7aa5d46b6489c9bdd054fa1 (diff)
downloadroflnauts-482797c1feab2b238822202593c1964c648d4198.zip
roflnauts-482797c1feab2b238822202593c1964c648d4198.tar.gz
roflnauts-482797c1feab2b238822202593c1964c648d4198.tar.bz2
HUD combo/lives
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`