Add initial window.
This commit is contained in:
parent
9bd7d6b23f
commit
0f9efd4d0b
21
snake/main.py
Normal file
21
snake/main.py
Normal file
@ -0,0 +1,21 @@
|
||||
import pygame
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
pygame.init()
|
||||
pygame.display.set_caption('Snake')
|
||||
surface = pygame.display.set_mode(size=(800, 600))
|
||||
clock = pygame.time.Clock()
|
||||
framerate = 25
|
||||
|
||||
shall_abort = False
|
||||
|
||||
while not shall_abort:
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.QUIT:
|
||||
shall_abort = True
|
||||
|
||||
surface.fill((0, 0, 0))
|
||||
|
||||
clock.tick(framerate)
|
||||
pygame.display.flip()
|
||||
Loading…
x
Reference in New Issue
Block a user