feat: create main loop and game window

This commit is contained in:
2021-06-02 03:15:40 -04:00
parent 6a5c24f05c
commit 0740fe066a
2 changed files with 20 additions and 0 deletions

BIN
img/tetris_icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

20
main.py Normal file
View File

@@ -0,0 +1,20 @@
import pygame
def main():
pygame.init()
screen = pygame.display.set_mode((800, 600))
pygame.display.set_caption("Tetris")
icon = pygame.image.load("img/tetris_icon.png")
pygame.display.set_icon(icon)
is_running = True
while is_running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
is_running = False
screen.fill((100, 149, 237))
pygame.display.update()
main()