Added global font & render current item
This commit is contained in:
4
game.py
4
game.py
@ -132,6 +132,8 @@ class Game(gameUtils.Game):
|
||||
# Blit the text surface to the wheel surface
|
||||
self.wheelSurf.blit(textSurf, (0, 0))
|
||||
|
||||
self.font = pygame.font.SysFont('', 50)
|
||||
|
||||
def spinnerTick(self):
|
||||
# If there's a tick already playing
|
||||
if time.perf_counter() - self.lastTickTime < self.tickSfx.get_length():
|
||||
@ -179,6 +181,8 @@ class Game(gameUtils.Game):
|
||||
# And set the last tick index to the current one
|
||||
self.lastTickItem = currentItemIdx
|
||||
|
||||
self.surf.blit(self.font.render(self.items[currentItemIdx].text, True, (255, 255, 255)), (0, 0))
|
||||
|
||||
def close(self):
|
||||
"""
|
||||
Ran when the game closes.
|
||||
|
||||
Reference in New Issue
Block a user