summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-01-13 18:44:38 +0100
committerAki <nthirtyone@gmail.com>2017-01-13 18:44:38 +0100
commit0b1edbb22c73177f46bc3d596d8bec45535cfb0f (patch)
tree3c48056899439bfe414fce879dade69448d63c68
parent1cbc419be94439ea1c18c595f12582c8ad75c234 (diff)
downloadroflnauts-0b1edbb22c73177f46bc3d596d8bec45535cfb0f.zip
roflnauts-0b1edbb22c73177f46bc3d596d8bec45535cfb0f.tar.gz
roflnauts-0b1edbb22c73177f46bc3d596d8bec45535cfb0f.tar.bz2
Portraits from nautsicons and menu button. Unified.
-rw-r--r--player.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/player.lua b/player.lua
index 53f138c..b95f596 100644
--- a/player.lua
+++ b/player.lua
@@ -41,7 +41,9 @@ Player = {
controlset = nil,
-- HUD
portrait_sprite = nil,
- portrait_sheet = require "portraits",
+ portrait_frame = nil,
+ portrait_sheet = require "nautsicons",
+ portrait_box = love.graphics.newQuad( 0, 15, 32,32, 80,130),
-- Sounds
sfx = require "sounds"
}
@@ -70,6 +72,7 @@ function Player:new (game, world, x, y, name)
-- Portrait load for first object created
if self.portrait_sprite == nil then
self.portrait_sprite = love.graphics.newImage("assets/portraits.png")
+ self.portrait_frame = love.graphics.newImage("assets/menu.png")
end
return o
end
@@ -319,7 +322,8 @@ function Player:drawHUD(x,y,scale,elevation)
-- hud displays only if player is alive
if self.alive then
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)
+ love.graphics.draw(self.portrait_frame, self.portrait_box, (x)*scale, (y)*scale, 0, scale, scale)
+ love.graphics.draw(self.portrait_sprite, self.portrait_sheet[self.name], (x+2)*scale, (y+3)*scale, 0, scale, scale)
local dy = 30 * elevation
love.graphics.setFont(Font)
love.graphics.print((self.combo*10).."%",(x+2)*scale,(y-3+dy)*scale,0,scale,scale)