-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDraw.py
More file actions
72 lines (64 loc) · 1.94 KB
/
Copy pathDraw.py
File metadata and controls
72 lines (64 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
from gasp import *
import time
def stop_smiling(x, y):
n = 30
while n < 90:
Circle((320 + x, 240 + y), 100, color="green", filled=True)
Circle((280 + x, 270 + y), 20, color="black", filled=True)
Circle((360 + x, 270 + y), 20, color="black", filled=True)
Arc((320 + x, 240 + y), 80, 180+n, 360-n, thickness = 4)
Line((300+x,220+y),(320+x,250+y),thickness = 4)
Line((300+x,220+y),(340+x,220+y),thickness = 4)
Line((360+x,340+y),(320+x,380+y),thickness = 4)
Line((280+x,340+y),(321+x,380+y),thickness = 4)
Line((280+x,340+y),(360+x,340+y),thickness = 4)
n += 15
time.sleep(1)
def serious_f(x, y):
n = 0
i = 0
while n < 30:
if n == 25:
i += 20
Circle((320 + x, 240 + y), 100, color="green", filled=True)
Circle((280 + x - i, 270 + y), 20, color="black", filled=True)
Circle((360 + x - i, 270 + y), 20, color="black", filled=True)
Line((290 + n + x, 200 + y), (350 + n + x, 200 + y),thickness = 4)
Line((300+x,220+y),(320+x,250+y),thickness = 4)
Line((300+x,220+y),(340+x,220+y),thickness = 4)
Line((360+x,340+y),(320+x,380+y),thickness = 4)
Line((280+x,340+y),(321+x,380+y),thickness = 4)
Line((280+x,340+y),(360+x,340+y),thickness = 4)
n += 25
time.sleep(0.9)
def move(i):
if i == 0:
return 0,0
elif i == 1:
return 120, 100
elif i == 2:
return -120, 100
elif i == 3:
return -120, -100
elif i == 4:
return 120, -100
begin_graphics()
n = ""
i = 0
while not n == "x":
if i == 4:
i = 0
x, y = move(i)
stop_smiling(x, y)
serious_f(x, y)
n = update_when('key_pressed')
i += 1
if n == "x":
break
clear_screen()
x, y = move(i)
stop_smiling(x, y)
serious_f(x, y)
clear_screen()
i += 1
end_graphics()