1
votes

So Im making a game and at the end of 60 seconds I want to make the screen change colors and display some end text. I set up the timer like this:

time = 60
TICKTOCK = 0 
pygame.time.set_timer (TICKTOCK+1, 1000)

and that's being displayed onscreen just fine, but when the end screen appear it flashes between the original white screen and the end screen. For some reason, it doesn't flash if I'm waving my mouse around the screen.

if time <= 0:
     playground.fill(black)
     playground.blit(end, (0, 100))

"end" is my game over text variable

    pygame.display.flip()
    playground.fill(white)
    clock.tick (fps) 

pygame.quit()

This is what I have at the end too if that helps

Is there a way I can make it appear steadily without having to change my timer?

1
probably you have to change other parts of you code. - furas
Is it because you're filling the background to white again? I have a feeling the fill function works without blitting it - Peter
why you fill(white) ? probably you don't need it. - furas

1 Answers

1
votes

You show not enough code so I can only suggest to do something like this

if not gameover:

    playground.fill(...)

    # draw normal game

else:

    playground.fill(...)

    # draw gameover text

playground.flip()