Голосование за лучший ответ
литвин
Профи
(689)
1 месяц назад
import pygame
# initialize pygame
pygame.init()
# create display & set caption
display = pygame.display.set_mode((640, 480))
pygame.display.set_caption("Snake Game by User")
# start game loop
game_end = False
while not game_end:
# event handling
for event in pygame.event.get():
if event.type == pygame.QUIT:
game_end = True
# drawing code goes here
# update display
pygame.display.update()
# quit pygame and exit program
pygame.quit()
quit()
# initialize pygame
pygame.init()
# create display & run update
display = pygame.display.set_mode((640, 480))
pygame.display.update()
pygame.display.set_caption("snakee game by user")
# start loop
game_end = False
white not game_end:
# game loop
for event in pygame.event.get():
if event.type == pygame.QUIT:
game_end = True
# draw stuff here
# close app, if required
pygame.quit()
quit()