diff options
author | Aki <nthirtyone@gmail.com> | 2016-05-21 20:35:47 +0200 |
---|---|---|
committer | Aki <nthirtyone@gmail.com> | 2016-05-21 20:35:47 +0200 |
commit | 482797c1feab2b238822202593c1964c648d4198 (patch) | |
tree | 0fbbeb1301ad8422090858ffc49abea7142c2f07 /player.lua | |
parent | 4b63616195fd1910b7aa5d46b6489c9bdd054fa1 (diff) | |
download | roflnauts-482797c1feab2b238822202593c1964c648d4198.zip roflnauts-482797c1feab2b238822202593c1964c648d4198.tar.gz roflnauts-482797c1feab2b238822202593c1964c648d4198.tar.bz2 |
HUD combo/lives
Diffstat (limited to 'player.lua')
-rw-r--r-- | player.lua | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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` |