forked from griffy/IronTrotter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hud.py
23 lines (21 loc) · 992 Bytes
/
hud.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import font
import colors
class HUD:
def __init__(self, player, width, height):
self.player = player
self.width = width
self.height = height
self.heading_font = font.Font("font/youmurdererbb_reg.ttf",
50,
fgcolor=colors.WHITE,
bgcolor=colors.CLEAR)
self.stats_font = font.Font("font/youmurdererbb_reg.ttf",
30,
fgcolor=colors.RED,
bgcolor=colors.CLEAR)
def draw(self):
# TODO: Actually replace with the map name if there is one,
# otherwise just leave the title
self.heading_font.draw(self.width/2-15, 25, "Iron Trotter")
self.stats_font.draw(self.width-60, 30, "HP: " + str(self.player.stats.hp))
self.stats_font.draw(self.width-60, 80, "Score: " + str(self.player.stats.score))