import pygame
#initialize the screen
pygame.init()
#create the screen
screen = pygame.display.set_mode((80, 600))
#tile and icon
pygame.display.set_caption("Space Invaders")
icon = pygame.image.load("spaceship.png")
pygame.display.set_icon(icon)
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.quit():
running = False
my pygame window closes as soon as it opens and then it displays the error pygame.error: video system not initialized. i use the community version of visual studio 2019.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…