Skip to content

Instantly share code, notes, and snippets.

@LevBravE
Created April 20, 2020 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LevBravE/1bde8c87211ac350e714515872229e19 to your computer and use it in GitHub Desktop.
Save LevBravE/1bde8c87211ac350e714515872229e19 to your computer and use it in GitHub Desktop.
import pygame
import random
def draw():
for i in range(10000):
screen.fill(pygame.Color('white'), (random.random() * width, random.random() * height, 1, 1))
size = width, height = 301, 301
screen = pygame.display.set_mode(size)
running = True
while running:
# внутри игрового цикл еще один цикл
# приема и обработки сообщений
for event in pygame.event.get():
# при закрытии окна
if event.type == pygame.QUIT:
running = False
# отрисовка и изменение свойств объектов
screen.fill((0, 0, 0))
draw()
# обновление экрана
pygame.display.flip()
pygame.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment