-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlua_scripts.h
More file actions
98 lines (94 loc) · 2.7 KB
/
lua_scripts.h
File metadata and controls
98 lines (94 loc) · 2.7 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#ifndef LUA_SCRIPTS_H
#define LUA_SCRIPTS_H
const char* launcher =
"colors = {}\n"
"x = 0\n"
"dx = 0.1\n"
"state = 'tune'\n"
"intro_tune = [[\n"
" X:1\n"
" L:1/4\n"
" Q:1/4=200\n"
" K:C\n"
" V:SINE\n"
" z2 d B/G/ [G3d3g3]\n"
" V:SAW\n"
" z4 G,,3 z2\n"
"]]\n"
"for i=1, 128 do\n"
" colors[i] = random(0,50)\n"
"end\n"
"counter = 0\n"
"game_counter = gamecount()\n"
"log('files found: ' .. game_counter)\n"
"gamecover(0)\n"
"function _draw()\n"
" if state == 'tune' then\n"
" sfx(intro_tune)\n"
" state = 'intro'\n"
" end\n"
" if state == 'intro' then\n"
" cls()\n"
" if x > 120 then\n"
" text(0xffffffff)\n"
" cursor(50, 64)\n"
" print('TINYBIT')\n"
" end\n"
" dx = dx * 1.06\n"
" x = x + dx\n"
" for i=1, 128 do\n"
" stroke(1, hsb(i, 255, 255))\n"
" line(128 + colors[i] - x, i, 450 - i - x, i)\n"
" end\n"
" if not sfx_active() then\n"
" state = 'slide_left'\n"
" x = 0\n"
" dx = 0.1\n"
" end\n"
" end\n"
" if state == 'game_select' then\n"
" if btnp(LEFT) then\n"
" counter = (counter + 1) % game_counter\n"
" gamecover(counter % game_counter)\n"
" state = 'slide_left'\n"
" x = 0\n"
" dx = 0.5\n"
" end\n"
" if btnp(RIGHT) then\n"
" counter = (counter - 1) % game_counter\n"
" gamecover(counter % game_counter)\n"
" state = 'slide_right'\n"
" x = 0\n"
" dx = 0.5\n"
" end\n"
" if btnp(A) then\n"
" gameload(counter)\n"
" end\n"
" end\n"
" if state == 'slide_left' then\n"
" dx = dx * 1.2\n"
" x = x + dx\n"
" if x >= 128 then\n"
" state = 'game_select'\n"
" x = 128\n"
" end\n"
" sprite(0, 0, 128, 128, 128-x, 0, 128, 128)\n"
" end\n"
" if state == 'slide_right' then\n"
" dx = dx * 1.2\n"
" x = x + dx\n"
" if x >= 128 then\n"
" state = 'game_select'\n"
" x = 128\n"
" end\n"
" sprite(0, 0, 128, 128, -128+x, 0, 128, 128)\n"
" end\n"
"end\n";
const char* error_screen =
"function _draw()\n"
" text(rgb(255, 255, 255))\n"
" fill(rgba(0, 0, 0, 255))\n"
" cursor(10, 10)\n"
" print('Lua error :(')\n"
"end\n";
#endif // LUA_SCRIPTS_H