Feb-06-2022, 04:23 PM
Hi everyone, I am trying to learn about the Pygame framework by following this Medium article. However, my code so far only shows the game window screen for a split second and then it closes out. I know that as long as my while loop boolean remains "True" it should keep the window screen open until the player exits out the screen. I am not sure why it keeps running to completion and closes by itself. Any or help or suggestions would be greatly appreciated. Thanks!
import pygame pygame.init() screen = pygame.display.set_mode((500, 500)) pygame.display.set_caption('Pygame from Medium') done = False while not done: for event in pygame.get(): if event.type == pygame.QUIT: done = True pygame.display.flip()