码迷,mamicode.com
首页 > 其他好文 > 详细

turtle-'一箭穿心',猿类的爱情

时间:2018-06-27 22:32:16      阅读:219      评论:0      收藏:0      [点我收藏+]

标签:rtl   for   图片   效果   font   forward   image   定义函数   IV   

基于python2.7。

 1 #coding:utf-8
 2 import turtle
 3 
 4 def curvemove():#定义函数画圆,200度
 5     for i in range(100):
 6         turtle.right(2)
 7         turtle.forward(2)
 8         turtle.speed(8)
 9         
10 turtle.color(red,(#F05B72))#设置画笔及填充颜色 
11 turtle.pensize(3)   
12 turtle.hideturtle()#隐藏画笔形状
13 turtle.speed(5)  
14 turtle.begin_fill()#开始填充
15 
16 turtle.left(140)
17 turtle.forward(111.65)
18 curvemove()
19 turtle.left(120)
20 curvemove()
21 turtle.forward(111.65)
22 turtle.end_fill()
23 
24 turtle.color((#F05B72),red)
25 turtle.begin_fill()
26 turtle.penup()
27 turtle.goto(60,0)
28 turtle.pendown()
29 turtle.right(80)
30 turtle.forward(111.65)
31 curvemove()
32 turtle.left(120)
33 curvemove()
34 turtle.forward(111.65)
35 turtle.end_fill()
36 
37 turtle.color(red,red)
38 turtle.begin_fill()
39 turtle.hideturtle()
40 turtle.penup()
41 turtle.goto(-150,20)
42 turtle.pendown()
43 turtle.pensize(5)
44 turtle.right(20)
45 turtle.right(60)
46 turtle.forward(15)
47 turtle.right(120)
48 turtle.forward(40)
49 turtle.right(60)
50 turtle.forward(14)
51 turtle.left(60)
52 turtle.forward(375)
53 turtle.left(90)
54 turtle.forward(10)
55 turtle.right(110)
56 turtle.forward(30)
57 turtle.right(140)
58 turtle.forward(30)
59 turtle.right(110)
60 turtle.forward(10)
61 turtle.left(90)
62 turtle.forward(375)
63 turtle.left(60)
64 turtle.forward(14)
65 turtle.right(60)
66 turtle.forward(40)
67 turtle.right(120)
68 turtle.forward(15)
69 turtle.end_fill()
70 
71 turtle.penup()  
72 turtle.goto(10.5,85)  
73 turtle.color("violet")  
74 turtle.write("L O V E", font=(Dutch801 XBd BT, 20, normal))  
75 
76 turtle.done()

最后效果图:

技术分享图片

遗憾:未能有效移除‘笔迹‘。

turtle-'一箭穿心',猿类的爱情

标签:rtl   for   图片   效果   font   forward   image   定义函数   IV   

原文地址:https://www.cnblogs.com/yueshangxigelou/p/9235867.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!