1 Star 0 Fork 0

qpython-android/funnypy

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
draw-doraemon.py 9.72 KB
一键复制 编辑 原始数据 按行查看 历史
quseitlab 提交于 2024-10-24 07:39 . 哆啦A梦的代码
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979
# -*- coding: utf-8 -*-
#哆啦A梦
#by QPY team
from turtle import *
import turtle
speed(0)
penup()
seth(180)
fd(200)
seth(0)
penup() #外圈头
circle(150, 40)
pendown()
fillcolor('dodgerblue')
begin_fill()
circle(150, 280)
end_fill() #外圈头
fillcolor("red")
begin_fill() #外圈头
seth(0) #项圈
fd(200)
circle(-5,90)
fd(10)
circle(-5,90)
fd(210)
circle(-5,90)
fd(10)
circle(-5,90)
end_fill() #项圈
fd(183) #右脸
left(45)
fillcolor("white")
begin_fill()
circle(120,100)
seth(90) #眼睛
a = 2.5
for i in range(120):
if 0 <= i < 30 or 60 <= i < 90:
a -= 0.05
lt(3)
fd(a)
else:
a += 0.05
lt(3)
fd(a)
penup()
seth(180)
fd(60)
pendown()
seth(90)
for i in range(120):
if 0 <= i < 30 or 60 <= i < 90:
a -= 0.05
lt(3)
fd(a)
else:
a += 0.05
lt(3)
fd(a) #眼睛
seth(180)
penup()
fd(60)
pendown()
seth(215)
circle(120,100)
end_fill() #脸部颜色和眼睛部分
seth(0) # 左眼珠部分
penup()
fd(40)
seth(90)
fd(170)
seth(0)
fd(5)
pendown()
fillcolor("black")
begin_fill()
circle(15,360)
end_fill()
seth(90)
penup()
fd(5)
pendown()
seth(0)
fillcolor("white")
begin_fill()
circle(4,360)
end_fill() #左眼珠部分
penup() #右眼珠
seth(0)
fd(58)
seth(270)
fd(15)
seth(0)
pensize(5)
circle(18,90)
pendown()
circle(18,180)
penup()
circle(18,90)
pendown()
pensize(1)#右眼珠
penup() #鼻子
seth(270)
fd(7)
seth(180)
fd(27)
pendown()
fillcolor("red")
begin_fill()
circle(20)
end_fill()#鼻子
seth(270)#嘴
penup()
fd(40)
pendown()
pencolor("black")
pensize(2)
fd(90)
seth(0)
circle(120,50)
penup()
circle(120,260)
pendown()
circle(120,50)#嘴
penup() #胡须
seth(90)
fd(60)
seth(0)
fd(20)
pendown()
fd(60)
penup()
fd(-60)
seth(90)
fd(20)
pendown()
seth(15)
fd(60)
penup()
fd(-60)
seth(270)
fd(40)
pendown()
seth(-15)
fd(50)
penup()
fd(-50)
seth(180)
fd(40)
pendown()
seth(-165)
fd(50)
penup()
fd(-50)
seth(90)
fd(40)
seth(165)
pendown()
fd(60)
fd(-60)
penup()
seth(280)
fd(20)
seth(180)
pendown()
fd(60) #胡须
penup() #下半身
home()
penup()
seth(180)
fd(200)
seth(0)
seth(90)
fd(36)
seth(0)
fd(98)
pendown()
fillcolor("dodgerblue")
begin_fill()
seth(50)
fd(70)
seth(40)
fd(20)
right(90)
fd(35)
right(75)
fd(105)
seth(90)
fd(10)
seth(-90)
fd(90)
seth(-95)
fd(80)
seth(180)
fd(80) # 右腿
penup() #左腿和过渡
fd(30)
seth(-90)
fd(30)
seth(0)
circle(30,90)
pendown()
circle(30,180)
penup()
circle(30,90)
seth(90)
fd(30)
seth(180)
fd(30)
pendown()
fd(80) #腿
seth(92)
fd(80)
seth(90)
fd(75)
fd(-30)
seth(-135)
fd(30)
right(90)
fd(40)
right(93)
fd(78)
seth(0)
fd(205)
end_fill()
fillcolor("red")# 项圈的补充
begin_fill()
circle(5,90)
fd(10)
circle(5,90)
fd(10)
end_fill()
penup()
seth(50)
fd(70)
seth(40)
fd(16)
right(90)
fd(20)
pendown()
fillcolor("white")# 手掌
begin_fill()
circle(30)
end_fill()
penup()
seth(-90)
fd(253)
seth(180)
fd(160)
seth(-90)
fd(30)
seth(0)
pendown()
fillcolor("white")
begin_fill()
penup()
circle(31,90)
pendown()
circle(31,180)
penup()
circle(31,90)
end_fill()
seth(90)
fd(30)
seth(0)
fd(24)
pendown()
seth(180)
circle(15,180)# 脚
fd(90)
circle(15,180)
fd(90)
penup()
seth(180)
fd(60)
penup()
seth(0)
pendown()
circle(-15,180)
fd(80)
circle(-15,180)
fd(80)
penup()
seth(180)
fd(140)
seth(90)
fd(90)
seth(-45)
pendown()
fillcolor("white")
begin_fill()
circle(30)
end_fill()
penup()
seth(-90)
fd(50)
seth(0)
fd(173)
seth(0)
fillcolor("white")# 胸
begin_fill()
pendown()
circle(90,128)
seth(180)
fd(145)
seth(-128)
circle(90,129)
end_fill()
seth(90)
penup()
fd(35)
seth(0)
pendown()
circle(70,90)# 口袋
seth(180)
fd(140)
seth(-90)
circle(70,90)
penup()
seth(90)
fd(90)
pendown()
seth(0)
fillcolor("#ffd200")#铃铛
begin_fill()
circle(20)
end_fill()
seth(90)
pensize(2)
fd(13)
fillcolor("black")
begin_fill()
seth(0)
circle(2)
end_fill()
seth(-90)
fd(13)
seth(0)
penup()
circle(20,110)
pendown()
seth(170)
fd(20)
seth(190)
fd(20)
penup()
seth(-90)
fd(3.5)
pendown()
seth(10)
fd(20)
seth(-10)
fd(22)
#大雄部分
pensize(1)
penup()
seth(0)
fd(400)
pendown()
speed(0)
fillcolor("black")
begin_fill()
seth(30)
circle(100,60)
fd(20) #右脸
seth(50)
circle(50,150)
seth(70)
fd(4)
seth(50)
fd(4)
fd(-4)
seth(70)
fd(-4)
seth(145)
fd(5)
seth(138)
fd(5)
fd(-5)
seth(145)
fd(-5)
seth(150)
circle(60,150)
seth(-90)
fd(20)
circle(84,92)
end_fill()
penup()
seth(90)
fd(110)
seth(0)
fd(50)
fillcolor("#FAFAD2")
begin_fill()
pendown()#发际线
seth(85)
fd(20)
seth(160)
fd(20)
seth(165)
fd(20)
seth(170)
fd(10)
seth(175)
fd(20)
seth(180)
fd(10)
seth(185)
fd(20)
seth(190)
fd(20)
seth(195)
fd(10)
seth(200)
fd(14.5)
seth(-85)
fd(30)#发际线
seth(-90)
fd(20)
circle(84,92)
seth(30)
circle(100.5,60)
fd(30)
end_fill()#脸的补全
penup()
seth(-90)
fd(10)
pendown()
fillcolor("#FAFAD2")
begin_fill()
seth(80)
circle(-8,190)
seth(-90)
fd(5)
seth(-95)
fd(5)
seth(-100)
fd(5)
seth(-105)
fd(5)
seth(-110)
fd(5)
circle(-8,135)
penup()
seth(90)
fd(15)
seth(0)
fd(3)
pendown()
seth(60)
fd(8)
seth(70)
fd(8)
fd(-8)
seth(70)
circle(-5,180)
seth(-120)
fd(14)
end_fill()
penup()
seth(180)
fd(142)
seth(90)
fd(23)
pendown()
fillcolor("#FAFAD2")
begin_fill()
seth(100)
circle(8,180)
seth(-90)
fd(6)
seth(-85)
fd(6)
seth(-80)
fd(6)
circle(8,140)
end_fill()
seth(100)
fd(20)
circle(5,210)
fd(7)
penup()
seth(0)
fd(142)
seth(90)
fd(9)
pendown()
seth(180)
fd(18)
seth(90)
fillcolor("white")
begin_fill()
a = 2.3
for i in range(120):
if 0 <= i < 30 or 60 <= i < 90:
a -= 0.05
lt(3)
fd(a)
else:
a += 0.05
lt(3)
fd(a)
penup()
seth(180)
fd(50)
seth(90)
pendown()
for i in range(120):
if 0 <= i < 30 or 60 <= i < 90:
a -= 0.05
lt(3)
fd(a)
else:
a += 0.05
lt(3)
fd(a)
end_fill()
seth(180)
penup()
fd(70)
pendown()
seth(0)
fd(20)
penup()
fd(34)
seth(-90)
fd(2)
pendown()
pensize(6)
circle(4)
penup()
seth(0)
fd(26)
seth(-90)
fd(2.5)
seth(0)
pendown()
circle(4)
pensize(2)
penup()
seth(90)
fd(40)
seth(0)
fd(15)
seth(30)
pendown()
fd(8)
seth(0)
fd(10)
seth(-40)
fd(15)
seth(-50)
fd(7)
seth(-60)
fd(7)
penup()
seth(180)
fd(95)
seth(90)
fd(25)
pendown()
seth(-145)
fd(10)
seth(-135)
fd(5)
seth(-125)
fd(5)
seth(-120)
fd(5)
seth(-115)
fd(5)
seth(-110)
fd(5)
penup()
seth(90)
fd(30)
seth(0)
fd(25)
pendown()
seth(-30)
fd(19)
penup()
pensize(1)
seth(0)
fd(13)
seth(-90)
fd(81)
seth(0)
pendown()
circle(8)
penup()
seth(-90)
fd(20)
seth(180)
fd(10)
seth(160)
pendown()
fd(25)
fd(-25)
seth(-15)
fd(5)
seth(-10)
fd(5)
seth(0)
fd(5)
seth(10)
fd(5)
seth(15)
fd(5)
seth(20)
fd(27)
seth(-90)
penup()
fd(25)
seth(180)
fd(36)
seth(0)
pendown()
fillcolor("white")
begin_fill()
circle(68.5,75)
seth(-105)
circle(-68.5,75)
circle(-72.5,78)
penup()
seth(-90)
fd(100)
seth(0)
fd(133)
seth(90)
fd(85)
end_fill()
fillcolor("#FAFAD2")
begin_fill()
seth(-160)
fd(104)
seth(0)
fd(38)
seth(-90)
fd(7.5)
pendown()
seth(0)
circle(66,76)
end_fill()
penup()
seth(180)
fd(80)
seth(-90)
fd(33.5)
pendown()
seth(-15)
fd(5)
seth(-10)
fd(5)
seth(0)
fd(5)
seth(10)
fd(5)
seth(15)
fd(5)
seth(20)
fd(27)
penup()
seth(180)
fd(12)
seth(-90)
fd(21)
pendown()
fillcolor("#FAFAD2")
begin_fill()
fd(12)
seth(180)
fd(46)
seth(90)
fd(11)
penup()
seth(-30)
fd(5)
seth(-20)
fd(5)
seth(-10)
fd(5)
seth(0)
fd(5)
pendown()
circle(73,27)
end_fill()
penup()
seth(-90)
fd(6)
seth(180)
fd(5)
pendown()
fillcolor("white")
begin_fill()
seth(-50)
fd(12)
seth(-100)
fd(30)
seth(135)
fd(40)
seth(-135)
fd(40)
seth(100)
fd(30)
seth(45)
fd(16)
end_fill()
fillcolor("#EEC900")
begin_fill()
fd(-16)
seth(-145)
fd(40)
circle(20,45)
fd(10)
left(10)
fd(5)
right(10)
fd(10)
left(90)
fd(25)
seth(85)
fd(25)
seth(75)
fd(10)
fd(-10)
seth(85)
fd(-25)
seth(-90)
fd(15)
seth(-85)
fd(18)
seth(0)
fd(95)
circle(6,180)
seth(90)
fd(30)
seth(95)
fd(35)
fd(-30)
right(90)
fd(25)
left(80)
fd(6)
left(6)
fd(6)
left(12)
fd(20)
circle(20,60)
fd(20)
end_fill()
penup()
seth(180)
fd(54)
seth(90)
fd(10)
pendown()
fillcolor("#FAFAD2")
begin_fill()
seth(-90)
fd(10)
seth(0)
fd(48)
seth(90)
fd(10)
end_fill()
seth(180)
penup()
fd(24)
pendown()
circle(-160,13)
seth(-13)
circle(160,13)
seth(0)
circle(160,12)
penup()
seth(-90)
fd(12)
seth(180)
fd(3)
pendown()
fillcolor("white")
begin_fill()
seth(-100)
fd(30)
seth(135)
fd(40)
seth(-135)
fd(40)
seth(100)
fd(26)
end_fill()
penup()
seth(0)
fd(20)
seth(90)
fd(2)
pendown()
seth(0)
fd(41)
penup()
seth(0)
fd(40)
seth(-90)
fd(53)
pendown()
fillcolor("#FAFAD2")
begin_fill()
seth(-80)
fd(60)
seth(-30)
fd(5)
seth(-40)
fd(5)
seth(-50)
fd(5)
seth(-60)
fd(5)
seth(-80)
fd(5)
seth(-90)
fd(5)
seth(-95)
fd(5)
seth(-135)
fd(6)
seth(-138)
fd(6)
seth(-143)
fd(6)
circle(-15,160)
seth(180)
circle(20,20)
seth(95)
fd(80)
end_fill()
penup()
fd(-90)
seth(0)
fd(20)
pendown()
seth(-70)
fd(10)
fd(-10)
penup()
seth(0)
fd(8)
seth(-70)
pendown()
fd(7)
fd(-7)
penup()
seth(0)
fd(8)
seth(-70)
fd(-10)
pendown()
fd(13)
penup()
seth(180)
fd(165)
seth(90)
fd(82)
seth(-95)
fillcolor("#FAFAD2")
begin_fill()
pendown()
fd(80)
seth(-150)
circle(20,190)
seth(145)
fd(10)
left(90)
fd(6)
fd(-14)
fd(8)
right(90)
fd(-7)
seth(45)
circle(20,80)
seth(85)
fd(85)
end_fill()
penup()
seth(-90)
fd(35)
seth(0)
fd(3)
pendown()
fillcolor("#FAFAD2")
begin_fill()
seth(-105)
fd(10)
seth(-87)
fd(70)
seth(-90)
fd(70)
seth(-145)
fd(20)
circle(10,160)
seth(0)
fd(50)
circle(5,110)
fd(20)
seth(90)
fd(50)
seth(87)
fd(60)
circle(-6,175)
fd(60)
seth(-90)
fd(50)
seth(-120)
fd(18)
circle(5,130)
seth(0)
fd(50)
circle(10,160)
fd(16)
seth(90)
fd(70)
seth(87)
fd(80)
end_fill()
penup()
seth(90)
fd(1)
fillcolor("#FF3E96")
begin_fill()
pendown()
seth(180)
fd(96)
seth(-105)
fd(10)
seth(-87)
fd(45)
seth(0)
fd(43)
seth(87)
fd(13)
circle(-6,175)
seth(-90)
fd(15)
seth(0)
fd(40)
end_fill()
penup()
seth(-90)
fd(98)
seth(180)
fd(40)
pendown()
seth(-10)
fd(15)
seth(0)
fd(15)
seth(10)
fd(15)
penup()
seth(180)
fd(62)
pendown()
seth(-170)
fd(15)
seth(180)
fd(15)
seth(-190)
fd(15)
#末尾加上这一行,不然画完后会闪退
turtle.done()
# hideturtle()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/qpython-android/funnypy.git
git@gitee.com:qpython-android/funnypy.git
qpython-android
funnypy
funnypy
master

搜索帮助