I just updated to pygame 2.0.0 and tried to run this basic window:
import pygame,sys
pygame.init()
screen = pygame.display.set_mode((800,800))
clock = pygame.time.Clock()
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
pygame.display.flip()
clock.tick(60)
When I run the code I get the welcome message:
pygame 2.0.0 (SDL 2.0.12, python 3.9)
Hello from the pygame community. https://www.pygame.org/contribute.html
But no window is being displayed and when I run other projects (that worked in pygame 1.9.6) I also don't get a window (but the welcome message is displayed and there is no error).
Do I need to add another line of code now? I am not sure what the problem is. (I am using windows 10)
What I tried so far:
- I tried both python 3.8.6 and python 3.9, neither displays a window
- When going back to pygame 1.9.6 everything works fine again (python 3.8.6)
- I updated and tried pygame on another windows pc (with python 3.8.3) and I get the same result: Welcome message, no error and no window
edit:
- So far I run the code in sublime but then tried to run the code from the powershell... and that works perfectly fine. I am really confused now.