#!/bin/python
import pygame, sys
import random
import math
green = (0, 255, 0)
blue = (0, 0, 128)
red = (255, 0, 0)
pygame.init()
sc = pygame.display.set_mode((500, 500))
pygame.display.set_caption("Транcформация линии 2")
state = 1
while True:
sc.fill((125,125,125))
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
if state == 1:
state = 2
for y in range(0,50):
r = random.randint(0,150)
s = random.randint(0,150)
pygame.draw.line(sc, (255, 255, 255),[r,y*10], [r+s, y*10], 3)
pygame.draw.rect(sc, (255, 255, 255), (r, y*10, 10, 10))
pygame.draw.rect(sc, (255, 255, 255), (r+s, y*10, 10, 10))
pygame.display.flip()
|