Задание 1 Смайлик
This commit is contained in:
29
lab2/task1_smiley.py
Normal file
29
lab2/task1_smiley.py
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import pygame
|
||||||
|
from pygame.draw import *
|
||||||
|
pygame.init()
|
||||||
|
FPS = 30
|
||||||
|
screen = pygame.display.set_mode((400, 400))
|
||||||
|
# фон
|
||||||
|
rect(screen, (200, 200, 200), (0, 0, 400, 400))
|
||||||
|
# лицо
|
||||||
|
circle(screen, (255, 255, 0), (200, 200), 120)
|
||||||
|
circle(screen, (0, 0, 0), (200, 200), 120, 3)
|
||||||
|
# глаза
|
||||||
|
circle(screen, (255, 0, 0), (160, 180), 25)
|
||||||
|
circle(screen, (0, 0, 0), (160, 180), 10)
|
||||||
|
circle(screen, (255, 0, 0), (240, 180), 20)
|
||||||
|
circle(screen, (0, 0, 0), (240, 180), 8)
|
||||||
|
# брови
|
||||||
|
polygon(screen, (0, 0, 0), [(110,130), (190,150), (180,160), (100,140)])
|
||||||
|
polygon(screen, (0, 0, 0), [(290,130), (210,150), (220,160), (300,140)])
|
||||||
|
# рот
|
||||||
|
rect(screen, (0, 0, 0), (150, 250, 100, 25))
|
||||||
|
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()
|
||||||
Reference in New Issue
Block a user