0
def main_menu():
    title_font = pygame.font.SysFont("comicsans", 70)
    run = True
    while run:
        WIN.blit(BG, (0,0))
        title_label = title_font.render("Press the mouse to begin...", 1, (255,255,255))
        WIN.blit(title_label, (WIDTH/2 - title_label.get_width()/2, 350))
    
        pygame.display.update()
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                run = False

            if event.type == pygame.KEYDOWN:
                if event.key == pygame.k_k:
                    print('ok')

I do not understand where I am not correctly indenting please help

  • 2
    Don't mix tabs and spaces. Use an editor that can visualize the difference. What you've supplied doesn't show tabs, so you'll have to look at your original – Mark Tolonen Sep 01 '22 at 22:25
  • As an aside: are you sure you don't want to `break` out of your loop or `return` from the `main_menu` function in the event of `pygame.QUIT`, rather than maintaining a `run` flag variable? – Chris Sep 01 '22 at 22:41

0 Answers0