-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex_en.html
242 lines (208 loc) · 6.43 KB
/
index_en.html
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>pico-8 cheatsheet</title>
<link rel="stylesheet" type="text/css" href="main.css"></link>
</head>
<body>
<div class="page">
<div class="title">
<h1>
PICO-8 Cheatsheet
</h1>
</div>
<div class="column">
<div class="block">
<h3>Commandline</h3>
<pre>
<code class="language-lua">HELP
SAVE GAME.P8
LOAD GAME.P8
RUN
SPLORE
</code></pre>
</div>
<div class="block">
<h3>Variables & Types</h3>
<pre><code class="language-lua">A=nil
X=23
local S="TEXT"
T={name="Joe", age="32"}
</code></pre>
</div>
<div class="block">
<h3>Operators</h3>
<pre><code class="language-lua">+ - * / ^ %
< > <= >= ~= ==
#list "A".."B"
and or not
</code></pre>
</div>
<div class="block">
<h3>Functions</h3>
<pre><code class="language-lua">FUNCTION ADD(a,b)
RETURN A+B
END</code></pre>
</div>
<div class="block">
<h3>If-Statement</h3>
<pre><code class="language-lua">IF (X < 33) THEN
PRINT("HALLO")
else
print("hey")
END</code></pre>
</div>
<div class="block">
<h3>Loops</h3>
<pre><code class="language-lua">--UP
FOR I = 1,10 DO
PRINT(I)
END
--DOWN
FOR A=10,0,-2 DO
PRINT(A)
END
--ARRAY
FOR S IN ALL(SHIPS) DO
PRINT(S.NAME)
END
--Table
FOR K,V IN PAIRS(M) DO
PRINT("K:"..K..",V:"..V)
END</code></pre>
</div>
<div class="block">
<h3>Tables</h3>
<pre><code class="language-lua">t={a="x",b=1}
add(t, v)
del(t, v)
t={1,2,3,4}
print(t[1]) --1-based!! </code></pre>
</div>
</div>
<div class="column">
<div class="block">
<h3>Special callbacks</h3>
<pre><code class="language-lua">_init() _update() _draw()</code></pre>
</div>
<div class="block">
<h3>Sprites</h3>
<pre><code class="language-lua">spr(n, x, y, [w, h],
[flip_x], [flip_y])
sspr(sx, sy, sw, sh,
dx, dy, [dw, dh],
[flip_x], [flip_y])</code></pre>
</div>
<div class="block">
<h3>Colors</h3>
<img src="./palette_numbers.png" width="100%">
<pre><code class="language-lua"></code></pre>
</div>
<div class="block">
<h3>Pixel</h3>
<pre><code class="language-lua">pset(x, y, [c])
pget(x,y)</code></pre>
</div>
<div class="block">
<h3>Shapes</h3>
<pre><code class="language-lua">rect(x0,y0,x1,y1, [col])
rectfill(x0,y0,x1,y1,[c])
circ(x, y, r, [c])
circfill(x, y, r, [c])
line(x0, y0, x1, y1, [c])</code></pre>
</div>
<div class="block">
<h3>Screen</h3>
<pre><code class="language-lua">cls()
camera([x, y])
clip([x, y, w, h])</code></pre>
<img src="screensize.png" width="100%">
</div>
<div class="block">
<h3>Map</h3>
<pre><code class="language-lua">mget(x, y)
mset(x, y, v)
map(map_x, map_y,
screen_x, screen_y,
width, height, [layer])</code></pre>
</div>
</div>
<div class="column">
<div class="block">
<h3>Controls</h3>
<div class="gray">
<img src="./controls.png" width="100%">
</div>
<p>
Player 1:
<br> ⬅︎⬆︎⬇︎➡︎ Y,X/C,V/N,M
<br> Player 2:
<br> ASDF, LSHIFT, A
<br>
</p>
<pre><code class="language-lua">btn([i, [p]])
btnp([i, [p]]) </code></pre>
</div>
<div class="block">
<h3>Sound</h3>
<pre><code class="language-lua">sfx(n, [chan, offset])
music([n, [fade, mask]])</code></pre>
</div>
<div class="block">
<h3>Tracker</h3>
<div style="background-color:#ddd; position: relative;">
<img src="./tracker.svg" width="100%">
</div>
<pre><code class="language-lua">0 none
1 slide
2 vibrato
3 drop (drum)
4 fade in
5 fade out
6 fast arpeggio
7 slow arpeggio</code></pre>
</div>
<div class="block">
<h3>Math</h3>
<pre><code class="language-lua">abs(x),atan2(dx, dy),
cos(x),sin(x),
flr(x),max(x,y),min(x,y),
rnd(x),sgn(x),sqrt(x)</code></pre>
</div>
<div class="block shortcut">
<h3>Shortcuts</h3> <b>Common:</b>
<br> Save: CTRL+S
<br> Change Mode: ESC
<br> Restart cart: CTRL+R
<br> <b>Editor</b>
<br> Undo:CTRL+Z
<br> Redo:CTRL+Y
<br> Search:CTRL+F
<br> Search-Next:CTRL+G
<br> Next Function:Alt+⬆︎⬇︎
</div>
<div class="block">
<div style="font-size: 12px;">
Pico-8 Cheatsheet. Version 2.1(en).
Collected by <a href="https://twitter.com/ztiromoritz">@ztiromoritz</a>.
Font: <a href="http://www.lexaloffle.com/info.php?page=1">Joseph White</a>.
TTF by <a href="http://www.lexaloffle.com/bbs/?tid=3109">RhythmLynx</a>.
Inspired by <a href="http://neko250.github.io/pico8-api/">@neko250/pico-8 api</a> and <a href="https://sectordub.itch.io/pico-8-fanzine-3">@obone/picozine-3</a>.
</div>
</div>
</div>
</div>
<div class="pdf">
<a href="./index.html">German Version</a>
<br>
<a href="./index_fr.html">French Version</a>
<br>
<a href="https://github.com/ztiromoritz/pico-8-spick/raw/master/build/pico-8-spickzettel.pdf">PDF (DE)</a>
<br>
<a href="https://github.com/ztiromoritz/pico-8-spick/raw/master/build/pico-8-cheatsheet.pdf">PDF (EN)</a>
<br>
<a href="https://github.com/ztiromoritz/pico-8-spick/raw/master/build/pico-8-antiseche.pdf">PDF (FR)</a>
</div>
</body>
</html>