Created
April 20, 2020 20:54
-
-
Save LevBravE/1bde8c87211ac350e714515872229e19 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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