feat: create main loop and game window
This commit is contained in:
BIN
img/tetris_icon.png
Normal file
BIN
img/tetris_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
20
main.py
Normal file
20
main.py
Normal 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()
|
||||||
Reference in New Issue
Block a user