from Texture import *

class HUD:

    def __init__(self,player):
        self.player = player
        self.heartTex = Texture("heart")
        self.barTex = Texture("blank")
        self.healthTex = Texture("blankRed")
        self.heartX = 10
        self.heartY = 10
        self.barTexX = 30
        self.barTexY = 10
        self.barLength = 64
        self.height = 16
        self.width = 16
        
    def draw(self):
        healthBarLen = self.player.health * 1.0 * self.barLength/self.player.maxHealth
        self.heartTex.draw(pos=(self.heartX, self.heartY), width=self.width, height=self.height)
        self.barTex.draw(pos=(self.barTexX, self.barTexY), width=self.barLength, height = self.height)
        self.healthTex.draw(pos=(self.barTexX, self.barTexY), width=healthBarLen, height = self.height)