Files
laba2/task1.py

41 lines
1.0 KiB
Python

import pygame
from pygame.draw import *
pygame.init()
FPS = 30
screen = pygame.display.set_mode((1000, 1000))
a = 30
dx = 80
y = 450
circle(screen, (210, 210, 80), (500, 500), 200)
circle(screen, (255, 255, 255), (500, 500), 200, 2)
circle(screen, (255, 0, 0), (500 - dx, y), a)
circle(screen, (255, 0, 0), (500 + dx, y), a)
circle(screen, (0, 0, 0), (500 - dx, y), 10)
circle(screen, (0, 0, 0), (500 + dx, y), 10)
circle(screen, (255, 255, 255), (500 - dx, y), a, 2)
circle(screen, (255, 255, 255), (500 + dx, y), a, 2)
polygon(screen, (0, 0, 0), [(400, 550), (400, 570), (600, 570), (600, 550)])
polygon(screen, (0, 0, 0), [(400, 380), (400, 400), (470, 450), (470, 430)])
polygon(screen, (255, 255, 255), [(400, 380), (400, 400), (470, 450), (470, 430)], 2)
polygon(screen, (0, 0, 0), [(400, 550), (400, 570), (600, 570), (600, 550)])
pygame.display.update()
clock = pygame.time.Clock()
finished = False
while not finished:
clock.tick(FPS)
for event in pygame.event.get():
if event.type == pygame.QUIT:
finished = True
pygame.quit()