import pygame
import random
import time
if __name__ == '__main__':
pygame.init()
screen = pygame.display.set_mode((1920,1000))
screen.fill((0, 0, 0))
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
exit()
from math import pi
a = random.randint(0,255)
b = random.randint(0,255)
c = random.randint(0,255)
# 脸
pygame.draw.rect(screen, (a, b, c), (760, 270, 350, 450))
# 眼睛
pygame.draw.rect(screen, (255, 255, 255), (810, 400, 90, 40))
pygame.draw.rect(screen, (255, 255, 255), (960, 400, 90, 40))
pygame.draw.line(screen, (0, 255, 0), (900, 420), (960, 420), 2)
pygame.draw.rect(screen, (255, 255, 255), (880, 600, 110, 60))
# 将内容展示在屏幕上
pygame.display.flip()
time.sleep(0.5)
自画像.png
网友评论