22 lines
472 B
Python
22 lines
472 B
Python
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()
|