-
Notifications
You must be signed in to change notification settings - Fork 0
/
kirby.anf
97 lines (68 loc) · 2.16 KB
/
kirby.anf
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
set FRAME_RATE to 24
set CANVAS_BACKGROUND to "#dedede"
set CANVAS_WIDTH to 500
set CANVAS_HEIGHT to 500
set MAX_NUM_OF_FRAMES to 1000
x = get_input("kirby-input.txt")
start_fr = 1
info(start_fr)
type(start_fr)
hoshi_no_kabi: Object
kabi_color: Text = "#ffb6c1"
cheeks_color: Text = "#cc4668"
kabi_body = circle(250, 250, 270)
kabi_body.fill(kabi_color)
kabi_body.stroke(kabi_color)
func make_part(x: Number, y: Number, width: Number, height: Number, colr: Color) returns Object:
part: Object = ellipse(x, y, width, height)
part.fill(colr)
part.stroke(colr)
return part
l_eye = make_part(220, 210, 38, 90, "#000000")
l_eye_shine = make_part(220, 185, 20, 40, "#ffffff")
l_eye.add(l_eye_shine)
r_eye = make_part(220+60, 210, 38, 90, "#000000")
r_eye_shine = make_part((220+60), 185, 20, 40, "#ffffff")
r_eye.add(r_eye_shine)
smile: Object = curve(230, 150, 230, 272, 270, 272, 270, 150)
smile.stroke("#000000")
smile.fill(kabi_color)
l_cheek: Object = ellipse(170, 260, 40, 20)
r_cheek: Object = ellipse(170+160, 260, 40, 20)
l_hand = ellipse(130, 280, 100, 110)
l_foot: Object = make_part(160, 370, 135, 100, cheeks_color)
r_foot = make_part(340, 370, 135, 100, cheeks_color)
kabi_eyes: Object = l_eye + r_eye
kabi_cheeks: Object = l_cheek + r_cheek
kabi_cheeks.fill(cheeks_color)
kabi_cheeks.stroke(cheeks_color)
hoshi_no_kabi: Object = l_hand + kabi_body
hoshi_no_kabi.fill(kabi_color)
hoshi_no_kabi.stroke(kabi_color)
func make_hand() returns Object:
sugoi = ellipse(360, 160, 100, 110)
sugoi.fill(kabi_color)
sugoi.stroke(kabi_color)
return sugoi
r_hand = make_hand()
func wave_hand(frame: Number, offset: Number):
repeat(sqrt(10/10) * 3.5):
r_hand.move(1, 2, frame, frame + offset)
func wave_hand_back(fr: Number, offset: Number):
repeat(sqrt(10/10) * 3.5):
r_hand.move(-1, -2, fr, fr + offset)
frame = start_fr
offset = 12
repeat(3):
wave_hand(frame, offset)
wave_hand_back(frame + offset, offset)
frame += 2 * offset
info(frame)
l_foot.draw(1, 1000)
r_foot.draw(1, 1000)
r_hand.draw(1, 1000)
hoshi_no_kabi.draw(1, 1000)
l_eye.draw(1, 1000)
r_eye.draw(1, 1000)
kabi_cheeks.draw(1, 1000)
smile.draw(1, 1000)