python用turtle画皮卡丘_用Python的turtle作画(2)——皮卡丘

本文介绍了一种使用Python的turtle模块绘制皮卡丘的详细方法。通过定义不同的函数,如face()来绘制皮卡丘的头部,eye()绘制眼睛,cheek()画脸颊,nose()画鼻子,mouth()画嘴,ear()画耳朵,逐步构建出皮卡丘的形象。代码中设置了颜色、填充以及海龟的移动和旋转,以完成皮卡丘的各个部分细节的绘制。
摘要由CSDN通过智能技术生成

from turtle import *

# 绘制皮卡丘头部

# 画脸

def face(x, y):

begin_fill()

penup()

# 将海龟移动到指定的坐标

goto(x, y)

pendown()

# 设置海龟的方向

setheading(40)

circle(-150, 69)

fillcolor("#FBD624")

# 将海龟移动到指定的坐标

penup()

goto(53.14, 113.29)

pendown()

setheading(300)

circle(-150, 30)

setheading(295)

circle(-140, 20)

print(position())

forward(5)

setheading(260)

circle(-80, 70)

print(position())

penup()

goto(-74.43, -79.09)

pendown()

penup()

# 将海龟移动到指定的坐标

goto(-144, 103)

pendown()

setheading(242)

circle(110, 35)

right(10)

forward(10)

setheading(250)

circle(80, 115)

print(position())

penup()

goto(-74.43, -79.09)

pendown()

setheading(10)

penup()

goto(-14

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值