|
|
|
@ -71,16 +71,22 @@ class Hud():
|
|
|
|
|
def __init__(self,player):
|
|
|
|
|
self.player = player
|
|
|
|
|
self.ratio = 1
|
|
|
|
|
self.font = pygame.font.SysFont('GlacialIndifference-Regular', 72)
|
|
|
|
|
self.font_large = pygame.font.SysFont('GlacialIndifference-Regular', 72)
|
|
|
|
|
self.font_small = pygame.font.SysFont('GlacialIndifference-Regular', 40)
|
|
|
|
|
|
|
|
|
|
def draw(self,surface):
|
|
|
|
|
# draw the life bar
|
|
|
|
|
pygame.draw.rect(surface,(255,0,0),(10,10,round(self.player.life/100*surface.get_width()/3),30),0)
|
|
|
|
|
pygame.draw.rect(surface,(255,255,255),(10,10,int(surface.get_width()/3),30),3)
|
|
|
|
|
|
|
|
|
|
text = self.font.render(str(self.player.ammo), True, (255, 255, 255))
|
|
|
|
|
text = self.font_large.render(str(self.player.ammo), True, (255, 255, 255))
|
|
|
|
|
surface.blit(text, (int(surface.get_width()-1.5*text.get_width()),int(surface.get_height()-1.5*text.get_height())))
|
|
|
|
|
|
|
|
|
|
def write_fps(self,surface,time_mili):
|
|
|
|
|
|
|
|
|
|
text = self.font_small.render(str(int(1/time_mili)), True, (255, 255, 255))
|
|
|
|
|
surface.blit(text, (int(surface.get_width()-1.5*text.get_width()),int(0.5*text.get_height())))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Carte():
|
|
|
|
|
def __init__(self,n):
|
|
|
|
|