动漫

发布时间 2023-12-01 19:59:27作者: 宝钗醉打林黛玉
import turtle as t
import time

def Move_turtle(x,y):
    t.up()
    t.goto(x,y)
    t.down()
# ——————————————————————————————————————————————————————————
# ---参数设置---
t.speed(3)
t.pensize(2)
t.setup(800,700,0,0)
t.bgcolor("Gainsboro")
Move_turtle(90,0)
# ——————————————————————————————————————————————————————————
# ---开始绘制---
# ——————————————————————————————————————————————————————————
# ---脸-廓---
t.seth(90)
t.circle(600,10)
Move_turtle(90,0)
t.seth(-92)
t.circle(700,10)
t.right(20)
t.circle(-100,20)
t.circle(-30,10)
t.seth(190)
t.fd(3)
t.fillcolor("black")
t.begin_fill()
t.circle(-300,50)
t.right(10)
t.circle(-400,7)
# ——————————————————————————————————————————————————————————
# ---衣---
t.seth(-78)
t.circle(200,40)
t.fd(10)
t.circle(210,10)
t.fd(80)
t.end_fill()
t.circle(-400,60)
# ——————————————————————————————————————————————————————————
# ---嘴---
Move_turtle(-10,-100)
t.seth(15)
t.fd(10)
t.seth(36)
t.fd(80)
Move_turtle(30,-100)
t.fd(30)
# ——————————————————————————————————————————————————————————
# ---调整位置---
t.up()
t.seth(90)
t.fd(120)
t.down()
# ——————————————————————————————————————————————————————————
# ---鼻子---
t.seth(145)
t.fd(10)
t.right(10)
t.fd(20)
t.right(20)
t.fd(38)
Move_turtle(54.27,37.63)
t.seth(-115)
t.fd(37)
t.right(50)
t.fd(10)
# ——————————————————————————————————————————————————————————
t.speed(10)
# ——————————————————————————————————————————————————————————
# ---上眼眶---
Move_turtle(-70,85)
t.seth(165)
t.fd(10)
t.seth(205)
t.fd(10)
t.circle(300,20)
t.fd(1)
# ——————————————————————————————————————————————————————————
# ---下眼眶---
t.seth(-15)
t.circle(300,10)
t.fd(2)
t.left(20)
t.circle(180,10)
t.left(10)
t.fd(10)
t.left(2)
t.fd(20)
# ——————————————————————————————————————————————————————————
#  ---眼珠---
t.fillcolor("gray")
Move_turtle(-98.45,35.49)
t.begin_fill()
for i in range(4):
    t.circle(15,90)
    t.fd(4)
t.end_fill()
#——————————————————————————————————————————————————————————
# ---爱心---
t.color('red')
t.begin_fill()
t.seth(180)
t.up()
t.fd(30)
t.down()
t.seth(-45)
t.forward(15)
t.left(90)
t.forward(15)
t.left(45)
t.circle(5.3,180)
t.left(180)
t.circle(5.3,180)
t.end_fill()
# ——————————————————————————————————————————————————————————
# ---衣---
t.pencolor("black")
Move_turtle(-196.71,-53.86)
t.seth(90)
t.circle(-300,50)
t.right(30)
t.fd(50)
t.right(30)
t.fd(40)
t.right(20)
t.left(20)
t.fd(10)
t.goto(80.88,104.19)
t.fillcolor("black")
t.begin_fill()
t.fd(20)
t.goto(90,0)
t.end_fill()
Move_turtle(99.67,97.35)
t.seth(120)
t.circle(200,20)
t.circle(9,10)
# ——————————————————————————————————————————————————————————
#收尾。
t.hideturtle()
time.sleep(1)
Move_turtle(90,0)
t.pencolor("black")
t.write("其实",font=('楷体',50,''))
time.sleep(2)
t.undo()
time.sleep(4)
t.pencolor("red")
Move_turtle(200,-300)
t.write("\n♥\n我\n喜\n欢\n你\n啊\n♥\n!",font=('楷体',50,''))
# ——————————————————————————————————————————————————————————

time.sleep(5)            #五秒后关闭