J
J
JadeShopKeeper2021-07-05 15:31:35
Python
JadeShopKeeper, 2021-07-05 15:31:35

Why is a Pygame window not responding immediately after opening?

import pygame
import sys

W, H = 10, 20
TILE = 45
GAME_RES = W * TILE, H * TILE
FPS = 60
pygame.init()
game_sc = pygame.display.set_mode(GAME_RES)
clock = pygame.time.Clock()

run = True
while run:
    game_sc.fill(pygame.Color('black'))
for event in pygame.event.get():
    if event.type == pygame.QUIT:
        run = False

pygame.display.flip()
clock.tick(FPS)


This is my first experience in python, I decided to create a simple tetris, but I ran into a problem, the pygame window is not responding. Looked at other forums but nothing helped.
Code above

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question