I'm trying to display text on a separated transparent layer after hitting a bonus. The screen blits for a milisecond and the game continues. Where did i make a mistake?
WIDTH = 500
HEIGHT = 600
screen = pygame.display.set_mode((WIDTH, HEIGHT))
surface = pygame.surface.Surface((WIDTH, HEIGHT))
def hit():
screen.blit(surface, (0, 0))
bonus = BONUSFONT.render("+3 points!", 1, (0, 0, 0))
bonus_text = (bonus, (200, 150))
bonus_end = pygame.time.get_ticks() + 3000
if bonus_text and pygame.time.get_ticks() < bonus_end:
surface.blit(*bonus_text)
I checked almost all the questions about surfaces and layers, but nothing helped me