I am trying to print "You Crashed" when car hits wall(or blocks) for 3 seconds and then again start game loop.
I tried using
time.sleep(3) but it's not working.
def crash(): crash_font = pygame.font.Font('freesansbold.ttf',115) crash_text = crash_font.render("You Crashed!",True,black) game_display.blit(crash_text,((display_width/4 - 100), (display_height/4 + 100))) pygame.display.update() time.sleep(3) game_loop() if x > display_width - car_width or x < 0: crash()
When I run this it blinks "You Crashed" for fraction of second and starts game_loop()
If anyone wants to see full code http://pastie.org/10940745