Python turtle库绘制复杂漫威蜘蛛侠Spiderman

演示效果

点击播放:Python123平台 济南大学_盛亚琪_spiderman

(https://www.python123.io/index/turtles/5c95d01e24577506dc75fa68)

效果演示

源代码

Alkey_Blog: https://alkey.xyz/Python turtle库绘制复杂漫威蜘蛛侠Spiderman
Alkey_Github: Python turtle库绘制复杂漫威蜘蛛侠Spiderman
'''
alkey.xyz
alkeysheng
university of jinan
2019.8
'''

from turtle import *
speed(13)  #绘画速度控制
bgcolor("#990000")
pensize(10)
penup()
goto(0,50)
pendown()
circle(-120)
penup()
circle(-120,-60)
pendown()
pensize(5)
right(50)
circle(70,55)
right(85)
circle(75,58)
right(90)
circle(70,55)
right(90)
circle(70,58)

#身子
penup()
pensize(10)
goto(80,15)
pendown()
seth(92)
fd(135)
seth(125)
circle(30,135)
seth(190)
fd(50)
seth(125)
circle(30,135)
seth(275)
fd(90)

#胳膊1
penup()
pensize(10)
goto(92,-150)
seth(240)
pendown()
fd(80)
left(10)
circle(-28,185)



#胳膊2
penup()
goto(0,50)
seth(0)
pensize(10)
circle(-120,-60)
seth(200)
pendown()
fd(72)
left(20)
circle(30,150)
left(20)
fd(20)
right(15)
fd(10)
pensize(5)
fillcolor("#3366cc")
begin_fill()
seth(92)
circle(-120,31)
seth(200)
fd(45)
left(90)
fd(52)
end_fill()
fd(-12)
right(90)
fd(40)
penup()
right(90)
fd(18)
pendown()
right(86)
fd(40)
penup()
goto(-152,-86)
pendown()
left(40)
circle(35,90)

#身体着色
penup()
goto(-80,116)
seth(10)
pensize(5)
pendown()
begin_fill()
fillcolor("#3366cc")
fd(155)
seth(-88)
fd(37)
seth(195)
fd(156)
end_fill()

penup()
goto(-75,38)
seth(15)
pendown()
begin_fill()
fd(158)
seth(-88)
fd(55)
seth(140)
circle(120,78)
end_fill()




#胳膊1着色
penup()
fillcolor("#3366cc")
pensize(5)
goto(75,-170)
pendown()
begin_fill()
seth(240)
fd(30)
right(90)
fd(17)
end_fill()
fd(10)
left(80)
fd(55)
penup()
left(90)
fd(15)
pendown()
left(85)
fd(55)
penup()
goto(43,-225)
left(84)
pendown()
circle(60,51)

speed(0)
#身体竖纹
for i in range(3):
    penup()
    goto(-70+i*15,135)
    seth(-90)
    pendown()
    pensize(5)
    fd(15-2*i)
for i in range(3):
    penup()
    goto(36 + i * 15, 156)
    seth(-90)
    pendown()
    pensize(5)
    fd(15 - 2 * i)

    a = -60
    b = 70
for i in range(4):
    penup()
    goto(a,b)
    a=a+40
    b=b+10
    seth(-90)
    pendown()
    pensize(5)
    fd(26)


def oo (li,jing):
    penup()
    goto(0,50)
    seth(0)
    circle(-120, li)
    pendown()
    right(jing)

pensize(5)
oo(-60,110)
fd(130)
oo(-28,96)
fd(140)
oo(9,89)
fd(144)
oo(42,70)
fd(160)
oo(80,60)
fd(130)

penup()
goto(-80,-40)
right(160)
pendown()
right(50)
circle(70,45)
right(75)
circle(70,38)
right(50)
circle(70,45)
right(90)
circle(70,48)

penup()
goto(-53,-70)
pendown()
left(40)
circle(70,30)
right(50)
circle(70,20)
right(50)
circle(70,38)
right(70)
circle(70,24)

penup()
goto(-19,-105)
left(72)
pendown()
fd(22)
right(60)
fd(22)

oo(-140,80)
circle(-90,120)

penup()
oo(140,100)
circle(90,13)
pendown()
right(-50)
circle(70,45)
right(75)
circle(70,38)
right(50)
circle(70,36)

penup()
goto(22,-185)
right(70)
pendown()
fd(72)

penup()
goto(-40,-182)
right(38)
pendown()
fd(70)




speed(10)

#左眼
penup()
pensize(7)
goto(-15,-110)
seth(0)
pendown()
pensize(10)
begin_fill()
left(130)
fd(110)
right(250)
circle(90,60)
circle(40,120)
fillcolor("#F5FFFA")
end_fill()
#右眼
penup()
goto(5,-110)
pendown()
begin_fill()
right(30)
fd(110)
right(-250)
circle(-90,60)
circle(-40,120)
end_fill()
done()
  • 34
    点赞
  • 93
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
通过使用pythonturtle绘制图形,我得到了很多收获。 首先,使用pythonturtle绘制图形可以帮助我更好地理解和应用编程的概念。在绘制图形的过程中,我需要使用很多编程基础知识和技巧,例如变量、循环、条件判断等等。通过实践绘制图形,我可以更深入地理解这些概念,并且能够将它们应用到其他编程任务中。 其次,使用pythonturtle可以培养我的创造力和想象力。在绘制图形的过程中,我可以自由发挥,设计出各种有趣的形状和图案。这让我感受到编程的乐趣,并且可以通过图形来表达自己的想法和创意。 此外,使用pythonturtle还可以提高我的问题解决能力。在绘制图形的过程中,我会遇到各种各样的问题,例如如何控制海龟的移动、如何调整图形的形状等等。通过不断尝试和调试,我能够找到解决问题的方法,并且学会了如何通过编程来解决实际问题。 最后,使用pythonturtle绘制图形还可以提升我的耐心和坚持能力。有时候绘制复杂的图形需要花费很长时间,但是我需要持续进行尝试和调整,直到达到预期的效果。这让我学会了面对困难时的耐心和坚持,同时也增加了我的毅力。 总之,通过使用pythonturtle绘制图形,我不仅学到了有关编程的知识和技巧,还培养了创造力、问题解决能力、耐心和坚持能力。这些收获对于我以后的学习和工作都非常有帮助。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值