-
Notifications
You must be signed in to change notification settings - Fork 2
/
fx_donuts.lua
93 lines (79 loc) · 1.57 KB
/
fx_donuts.lua
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
function fx_donuts()
local donuty, donutx, show_mega, offy, angles, tunnel, tunnel_active, move_donuts, px, py, dscale =
128, 0, false, 210, {0, 0, 0}, {}, false, false, 0, 0, 47
set_palette({128, 133, 132, 4, 9, 10, 7, 7, 9, 10, 11, 0})
local function show_tunnel()
tunnel_active = true
for c = 1, 8 do
add(tunnel, {10, rnd(14)})
wait_frames(10)
end
wait_sync()
tunnel_active = false
end
return function()
pico_text_show(false)
wait_frames(60)
show_tunnel()
stars_set_mode(1)
pico_text_hide()
wait_frames(30)
while loop_frames(64) do
donuty -= 2
end
move_donuts, show_mega = true, true
wait_frames(120)
while loop_frames(210) do
offy -= 1
end
wait_sync()
move_donuts = false
while loop_frames(64) do
donuty += 3
end
spr_text_show()
pico_text_show()
pico_text_show()
spr_text_hide()
stars_set_mode(2, 2)
wait_frames(30)
show_tunnel()
while loop_frames(15) do
dscale += 10
end
end,
function()
stars_update()
angles[1] += 0.005
angles[2] += 0.007
angles[3] += 0.002
if move_donuts then
donutx, donuty = ssin(px, 32) - 32, ssin(py, 32) - 32
px += 0.005
py += 0.007
end
for r in all(tunnel) do
r[1] *= 1.12
if r[1] > 80 and tunnel_active then
r[1], r[2] = rndp(4, 8), rnd(14)
end
end
end,
function()
stars_draw()
for r in all(tunnel) do
circ(64, 64, r[1], flr(r[2]) + 0x1001)
end
local y, f = donuty, 0
while y < 128 do
local x = donutx + f
while x < 128 do
spr(171, x, y, 2, 2)
x += 32
end
y += 16
f = bxor(f, 16)
end
if (show_mega) m3d_shaded(m_vertices[4], m_tris[4], angles, dscale, {0, offy, 200})
end
end