File tree 1 file changed +120
-0
lines changed
1 file changed +120
-0
lines changed Original file line number Diff line number Diff line change
1
+ import turtle
2
+
3
+ BODY_COLOR = 'red'
4
+ BODY_SHADOW = ''
5
+ GLASS_COLOR = '#9acedc'
6
+ GLASS_SHADOW = ''
7
+
8
+ s = turtle .getscreen ()
9
+ t = turtle .Turtle ()
10
+
11
+ # it can move forward backward left right
12
+
13
+
14
+ def body ():
15
+ """ draws the body """
16
+ t .pensize (20 )
17
+ # t.speed(15)
18
+
19
+ t .fillcolor (BODY_COLOR )
20
+ t .begin_fill ()
21
+
22
+ # right side
23
+ t .right (90 )
24
+ t .forward (50 )
25
+ t .right (180 )
26
+ t .circle (40 , - 180 )
27
+ t .right (180 )
28
+ t .forward (200 )
29
+
30
+ # head curve
31
+ t .right (180 )
32
+ t .circle (100 , - 180 )
33
+
34
+ # left side
35
+ t .backward (20 )
36
+ t .left (15 )
37
+ t .circle (500 , - 20 )
38
+ t .backward (20 )
39
+
40
+ # t.backward(200)
41
+ t .circle (40 , - 180 )
42
+ # t.right(90)
43
+ t .left (7 )
44
+ t .backward (50 )
45
+
46
+ # hip
47
+ t .up ()
48
+ t .left (90 )
49
+ t .forward (10 )
50
+ t .right (90 )
51
+ t .down ()
52
+ # t.right(180)
53
+ #t.circle(25, -180)
54
+ t .right (240 )
55
+ t .circle (50 , - 70 )
56
+
57
+ t .end_fill ()
58
+
59
+
60
+ def glass ():
61
+ t .up ()
62
+ # t.right(180)
63
+ t .right (230 )
64
+ t .forward (100 )
65
+ t .left (90 )
66
+ t .forward (20 )
67
+ t .right (90 )
68
+
69
+ t .down ()
70
+ t .fillcolor (GLASS_COLOR )
71
+ t .begin_fill ()
72
+
73
+ t .right (150 )
74
+ t .circle (90 , - 55 )
75
+
76
+ t .right (180 )
77
+ t .forward (1 )
78
+ t .right (180 )
79
+ t .circle (10 , - 65 )
80
+ t .right (180 )
81
+ t .forward (110 )
82
+ t .right (180 )
83
+
84
+ # t.right(180)
85
+ t .circle (50 , - 190 )
86
+ t .right (170 )
87
+ t .forward (80 )
88
+
89
+ t .right (180 )
90
+ t .circle (45 , - 30 )
91
+
92
+ t .end_fill ()
93
+
94
+
95
+ def backpack ():
96
+ t .up ()
97
+ t .right (60 )
98
+ t .forward (100 )
99
+ t .right (90 )
100
+ t .forward (75 )
101
+
102
+ t .fillcolor (BODY_COLOR )
103
+ t .begin_fill ()
104
+
105
+ t .down ()
106
+ t .forward (30 )
107
+ t .right (255 )
108
+
109
+ t .circle (300 , - 30 )
110
+ t .right (260 )
111
+ t .forward (30 )
112
+
113
+ t .end_fill ()
114
+
115
+
116
+ body ()
117
+ glass ()
118
+ backpack ()
119
+
120
+ t .screen .exitonclick ()
You can’t perform that action at this time.
0 commit comments