I am using pygame and I want to stop rendering images at a certain point, so I can create a main menu, a game state, and stuff like that. So I tried using booleans but that did not work.
Here is the code:
import pygame
pygame.init()
WIDTH, HEIGHT = 800, 600
win = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("Lemonade Stand: Hard Mode")
clock = pygame.time.Clock()
main_menu = pygame.image.load('Art/Main Menu/main_menu.png')
play_button = pygame.image.load('Art/Main Menu/play.png')
main_menu = True
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
exit()
if main_menu:
win.blit(main_menu, (0, 0))
win.blit(play_button, (510, 150))
pygame.display.update()
clock.tick(60)