Added global font & render current item

This commit is contained in:
2025-06-26 14:50:41 +01:00
parent 471de3ef6e
commit a1c5641eee

View File

@ -132,6 +132,8 @@ class Game(gameUtils.Game):
# Blit the text surface to the wheel surface # Blit the text surface to the wheel surface
self.wheelSurf.blit(textSurf, (0, 0)) self.wheelSurf.blit(textSurf, (0, 0))
self.font = pygame.font.SysFont('', 50)
def spinnerTick(self): def spinnerTick(self):
# If there's a tick already playing # If there's a tick already playing
if time.perf_counter() - self.lastTickTime < self.tickSfx.get_length(): 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 # And set the last tick index to the current one
self.lastTickItem = currentItemIdx self.lastTickItem = currentItemIdx
self.surf.blit(self.font.render(self.items[currentItemIdx].text, True, (255, 255, 255)), (0, 0))
def close(self): def close(self):
""" """
Ran when the game closes. Ran when the game closes.