Question: I'm making a game, where when a player steps outside the screen, the level starts. I wish to show an image of "LEVEL 1" before the game starts, yet the program shows the image too quickly. My framerate is at 60. 

I am wondering if there is a way to delay time for about 5 seconds during the screen blitting but after it resumes to it's normal pace. The problem for me with the `pygame.time.delay()` and wait stuff is that is slows the entire program down. 

Is there a easier way?

EDIT\_\_\_\_\_\_ CODE

```
 #START OF LEVEL 1
    if level1:

        screen.blit(level1_image,background_position)
        pygame.time.delay(500)
        level1yay = True
    if level1yay:

        screen.blit(background,background_position)

#Flip the Display
    pygame.display.flip()
    clock.tick(time)

#Quit
pygame.quit()

```

The first image is not displayed and goes directly to the second image

Answer: 
You could set up a timer and keep track of the time. when the timer reaches the delay you want you can do something.

In the example below I set up the timer and I set the level1yay to true only once the timer has reached the delay value.

I added a condition canexit so the game doesn't terminate on the first loop. I assumed that the condition for "if level1: " has been set somewhere else.

```
mytimer = pygame.time.Clock() #creates timer
time_count = 0 #will be used to keep track of the time
mydelay = 5000 # will delay the main game by 5 seconds
canexit = False

#updates  timer
    mytimer.tick()
    time_count += mytimer.get_time()
#check if mydelay has been reached
    if  time_count >= mydelay:
        level1yay = True
        canexit = True

#START OF LEVEL 1
    if level1:
        screen.blit(level1_image,background_position)

    if level1yay:
        screen.blit(background,background_position)

#Flip the Display
    pygame.display.flip()
    clock.tick(time)

 #Quit
 if canexit ==  True:
    pygame.quit()

```

EDIT TO INCLUDE ACTIONS PRIOR TO ENTERING LEVEL1:

```
mytimer = pygame.time.Clock() #creates timer
time_count = 0 #will be used to keep track of the time
mydelay = 5000 # will delay the main game by 5 seconds
canexit = False
start_menu = True # to start with the start menu rather than level1

#Do something before level 1
    if start_menu == True:
        ... do stuff
        if start_menu end:
             level1 = True
             time_count = 0

#START OF LEVEL 1
    if level1 == True:
    #updates  timer
        mytimer.tick() # start's ticking the timer
        time_count += mytimer.get_time() # add's the time since the last tick to time_count
    #check if mydelay has been reached
        if  time_count >= mydelay:
            level1 = False # so that you do not enter level1 again (even though this is redundant here since you will exit the game at the end of the loop... see canexit comment)
            level1yay = True # so that you can enter level1yay
            canexit = True # so that the game terminates at the end of the game loop 
            screen.blit(level1_image,background_position)

    if level1yay:
        screen.blit(background,background_position)

#Flip the Display
    pygame.display.flip()
    clock.tick(time)

 #Quit
 if canexit ==  True:
    pygame.quit()

```
I don't know if this will really work, but you could try displaying the same image of "LEVEL 1" multiple times in a row, so it appears to stay around longer, but the program itself is never actually delayed.