关于python:Python绘制冰墩墩雪容融

15次阅读

共计 780 个字符,预计需要花费 2 分钟才能阅读完成。

冰墩墩

局部代码实现:

t.hideturtle()
# 设置速度
t.title("Bing Dwen Dwen")
# t.delay(2)  # 提早
t.speed(200)  # 速度
# turtle.tracer(False)
# 双耳
# 左耳
t.penup()
t.goto(-150, 200)
t.setheading(160)
t.begin_fill()
t.pendown()
t.circle(-30, 230)
t.setheading(180)
t.circle(37, 90)
t.end_fill()
# 右耳
t.penup()
t.goto(60, 200)
t.setheading(20)
t.begin_fill()
t.pendown()
t.circle(30, 230)
t.setheading(0)
t.circle(-37, 90)
t.end_fill()

成果:

雪容融

局部代码实现:

pm=Screen() #新建屏幕对象
pm.delay (2)  #设定屏幕延时为 0
pm.title("雪容融")
turtle.hideturtle()
turtle.speed(2)  # 速度


# 大头的圈圈
turtle.penup()
turtle.goto(-145, 135)
turtle.pensize(10)
turtle.pencolor("#BB3529")
turtle.fillcolor("#DA2D20")
turtle.begin_fill()
turtle.pendown()
turtle.setheading(45)
turtle.circle(-150, 45)
turtle.forward(80)
turtle.circle(-150, 180)
turtle.forward(80)
turtle.circle(-150, 135)
turtle.end_fill()

成果:

源码在公众号 Python 小二 后盾回复 冰雪 获取~

正文完
 0