#!/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формация линии")
clock = pygame.time.Clock()
x1 = 0
y1 = 0
size1 = 500
size2 = 0
while True:
sc.fill((125,125,125))
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
sys.exit()
pygame.draw.line(sc, (255, 255, 255),[x1+size1,y1], [x1+size2, y1], 3)
y1 = y1 + 1
size1 = size1 - 1
size2 = size2 + 1
pygame.display.flip()
clock.tick(60)
|