import pygame
pygame.init()
screen = pygame.display.set_mode((800,600))
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.quit():
running = False
This code right here is basic pygame code with window size, the main game loop, and event loop.
When I run this code, the pygame window opens and closes instantly. It gives me this error:
video system has not initialized, line 11, in <module> for event in pygame.event.get():