Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | None | 0 0
  1. import pygame
  2. from random import randint
  3.  
  4. window = pygame.display.set_mode((800, 600))
  5. pygame.display.set_caption("Тестовая игра")
  6.  
  7. running = True
  8.  
  9. while running:
  10.     for event in pygame.event.get():
  11.         if event.type == pygame.QUIT:
  12.             running = False
  13.         if event.type == pygame.KEYDOWN:
  14.             if event.key == pygame.K_ESCAPE:
  15.                 running = False
  16.  
  17.     window.fill((randint(0, 255), randint(0, 255), randint(0, 255)))
  18.  
  19.     pygame.display.flip()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement