Repository navigation
Expand file tree
/
Copy pathsprites.py
More file actions
241 lines (233 loc) · 7.77 KB
/
Copy pathsprites.py
File metadata and controls
241 lines (233 loc) · 7.77 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
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
"""
8x8 sprite data for the lightwall sprite mode.
Extracted from a sprite sheet by tools/extract_sprites.py in the server repo.
The sheet was a resampled upscale, so every logical pixel came out a slightly
different shade -- the heart used 25 colours for its 25 pixels. Colours within
a Manhattan distance of 78 were therefore merged onto one shared palette. That
removes the noise and also suits the wall: behind frosted plexiglass subtle
shading is lost anyway, so bold flat colour reads better.
Palette index 0 means unlit. Entries 1..34 index the palette below.
Sprites were chosen for clear silhouettes with useful negative space. Nearly
solid ones were rejected on purpose -- one filling 62 of 64 pixels reads as a
bright square through diffusion, not as an object.
Generated -- do not hand edit. Mirrored by lightwall/lightwall/sprites.h.
"""
SPRITE_SIZE = 8
SPRITE_NAMES = [
'heart',
'skull',
'key',
'bolt',
'bell',
'flask',
'mushroom',
'cactus',
'ghost',
'droplet',
'pacman',
'cloud',
'star',
'lock',
'globe',
'invader',
]
# (r, g, b) for palette indices 1..34.
SPRITE_PALETTE = [
(253, 253, 253), # 1 #fdfdfd
(123, 123, 123), # 2 #7b7b7b
(248, 216, 119), # 3 #f8d877
(248, 54, 1), # 4 #f83601
(192, 184, 191), # 5 #c0b8bf
(227, 96, 24), # 6 #e36018
(167, 228, 248), # 7 #a7e4f8
(251, 182, 7), # 8 #fbb607
( 61, 190, 251), # 9 #3dbefb
(157, 51, 43), # 10 #9d332b
(255, 154, 63), # 11 #ff9a3f
( 71, 5, 2), # 12 #470502
( 94, 86, 96), # 13 #5e5660
(183, 140, 68), # 14 #b78c44
(255, 239, 179), # 15 #ffefb3
( 20, 120, 250), # 16 #1478fa
(191, 246, 63), # 17 #bff63f
( 11, 169, 0), # 18 #0ba900
( 32, 117, 38), # 19 #207526
( 96, 228, 218), # 20 #60e4da
( 24, 137, 131), # 21 #188983
( 9, 64, 88), # 22 #094058
( 43, 207, 188), # 23 #2bcfbc
( 17, 2, 219), # 24 #1102db
( 3, 19, 57), # 25 #031339
(107, 98, 235), # 26 #6b62eb
( 19, 17, 127), # 27 #13117f
(220, 215, 219), # 28 #dcd7db
(103, 65, 21), # 29 #674115
(168, 125, 0), # 30 #a87d00
(165, 126, 157), # 31 #a57e9d
(239, 127, 242), # 32 #ef7ff2
(138, 39, 130), # 33 #8a2782
(219, 7, 208), # 34 #db07d0
]
# Row-major palette indices, 0 is unlit.
SPRITE_DATA = [
[ # 0 heart
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 10, 0, 10, 6, 0, 0,
0, 6, 3, 6, 4, 4, 6, 0,
6, 4, 4, 4, 4, 11, 4, 0,
0, 12, 4, 4, 11, 4, 0, 0,
0, 0, 10, 4, 4, 0, 0, 0,
0, 0, 0, 6, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
],
[ # 1 skull
0, 0, 0, 0, 0, 0, 0, 0,
0, 5, 5, 5, 1, 31, 0, 0,
1, 0, 0, 1, 0, 0, 5, 0,
1, 0, 6, 1, 6, 0, 5, 0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