1 /**********************************************************************************
2 * Copyright (c) 2008, 2009 Derek Yu and Mossmouth, LLC
3 * Copyright (c) 2018, Ketmar Dark
5 * This file is part of Spelunky.
7 * You can redistribute and/or modify Spelunky, including its source code, under
8 * the terms of the Spelunky User License.
10 * Spelunky is distributed in the hope that it will be entertaining and useful,
11 * but WITHOUT WARRANTY. Please see the Spelunky User License for more details.
13 * The Spelunky User License should be available in "Game Information", which
14 * can be found in the Resource Explorer, or as an external file called COPYING.
15 * If not, please obtain a new copy of Spelunky from <http://spelunkyworld.com/>
17 **********************************************************************************/
18 void processTitleExit (MapEntity door) {
19 auto scdoor = TitleTileShortcutDoor(door);
21 restartGame(); // this will NOT generate a new level
22 global.currLevel = scdoor.startLevel;
23 generateNormalLevel();
27 if (door isa TitleTileXTutorial) {
32 if (door isa TitleTileXScores) {
39 void createTitleRoom () {
41 //global.darkLevel = true;
43 setRoomBounds(0, 0, 624, 232-16);
44 levBGImgName = 'bgCave';
45 //levBGImgName = 'sTitleBG';
47 //!MakeMapTile(7, 2, 'oGame');
48 //!MakeMapTile(8, 2, 'oBricks');
49 //!MakeMapTile(6, 2, 'oTitle');
51 MakeMapTile(0, 0, 'oBrick');
52 MakeMapTile(1, 0, 'oBrick');
53 MakeMapTile(2, 0, 'oBrick');
54 MakeMapTile(3, 0, 'oBrick');
55 MakeMapTile(4, 0, 'oBrick');
56 MakeMapTile(5, 0, 'oBrick');
57 MakeMapTile(6, 0, 'oBrick');
58 MakeMapTile(7, 0, 'oBrick');
59 MakeMapTile(8, 0, 'oBrick');
60 MakeMapTile(9, 0, 'oBrick');
61 MakeMapTile(10, 0, 'oBrick');
62 MakeMapTile(11, 0, 'oBrick');
63 MakeMapTile(12, 0, 'oBrick');
64 MakeMapTile(13, 0, 'oBrick');
65 MakeMapTile(14, 0, 'oBrick');
66 MakeMapTile(15, 0, 'oBrick');
67 MakeMapTile(16, 0, 'oBrick');
68 MakeMapTile(17, 0, 'oBrick');
69 MakeMapTile(18, 0, 'oBrick');
70 MakeMapTile(19, 0, 'oBrick');
71 MakeMapTile(20, 0, 'oBrick');
72 MakeMapTile(21, 0, 'oBrick');
73 MakeMapTile(22, 0, 'oBrick');
74 MakeMapTile(23, 0, 'oBrick');
75 MakeMapTile(24, 0, 'oBrick');
76 MakeMapTile(25, 0, 'oBrick');
77 MakeMapTile(26, 0, 'oBrick');
78 MakeMapTile(27, 0, 'oBrick');
79 MakeMapTile(28, 0, 'oBrick');
80 MakeMapTile(29, 0, 'oBrick');
81 MakeMapTile(30, 0, 'oBrick');
82 MakeMapTile(31, 0, 'oBrick');
83 MakeMapTile(32, 0, 'oBrick');
84 MakeMapTile(33, 0, 'oBrick');
85 MakeMapTile(34, 0, 'oBrick');
86 MakeMapTile(35, 0, 'oBrick');
87 MakeMapTile(36, 0, 'oBrick');
88 MakeMapTile(37, 0, 'oRope');
89 MakeMapTile(38, 0, 'oBrick');
90 MakeMapTile(39, 0, 'oBrick');
91 MakeMapTileAtPix(592, 8, 'oRope');
92 MakeMapTile(0, 1, 'oBrick');
93 MakeMapTile(1, 1, 'oBrick');
94 MakeMapTile(2, 1, 'oBrick');
95 MakeMapTile(3, 1, 'oBrick');
96 MakeMapTile(4, 1, 'oBrick');
97 MakeMapTile(5, 1, 'oBrick');
98 MakeMapTile(6, 1, 'oBrick');
99 MakeMapTile(7, 1, 'oBrick');
100 MakeMapTile(8, 1, 'oBrick');
101 MakeMapTile(9, 1, 'oBrick');
102 MakeMapTile(10, 1, 'oBrick');
103 MakeMapTile(11, 1, 'oBrick');
104 MakeMapTile(12, 1, 'oBrick');
105 MakeMapTile(13, 1, 'oBrick');
106 MakeMapTile(14, 1, 'oBrick');
107 MakeMapTile(15, 1, 'oBrick');
108 MakeMapTile(16, 1, 'oBrick');
109 MakeMapTile(17, 1, 'oBrick');
110 MakeMapTile(18, 1, 'oBrick');
111 MakeMapTile(19, 1, 'oBrick');
112 MakeMapTile(20, 1, 'oBrick');
113 MakeMapTile(21, 1, 'oBrick');
114 MakeMapTile(22, 1, 'oBrick');
115 MakeMapTile(23, 1, 'oBrick');
116 MakeMapTile(24, 1, 'oBrick');
117 MakeMapTile(25, 1, 'oBrick');
118 MakeMapTile(26, 1, 'oBrick');
119 MakeMapTile(27, 1, 'oBrick');
120 MakeMapTile(28, 1, 'oBrick');
121 MakeMapTile(29, 1, 'oBrick');
122 MakeMapTile(30, 1, 'oBrick');
123 MakeMapTile(31, 1, 'oBrick');
124 MakeMapTile(32, 1, 'oBrick');
125 MakeMapTile(33, 1, 'oBrick');
126 MakeMapTile(34, 1, 'oBrick');
127 MakeMapTile(35, 1, 'oQuitSign');
128 MakeMapTile(37, 1, 'oRope');
129 MakeMapTile(38, 1, 'oBrick');
130 MakeMapTile(39, 1, 'oBrick');
131 MakeMapTileAtPix(592, 24, 'oRope');
132 MakeMapTile(0, 2, 'oBrick');
133 MakeMapTile(1, 2, 'oBrick');
134 MakeMapTile(2, 2, 'oBrick');
135 MakeMapTile(3, 2, 'oBrick');
136 MakeMapTile(4, 2, 'oBrick');
137 MakeMapTile(5, 2, 'oBrick');
138 MakeMapTile(17, 2, 'oBrick');
139 MakeMapTile(18, 2, 'oBrick');
140 MakeMapTile(19, 2, 'oBrick');
141 MakeMapTile(20, 2, 'oBrick');
142 MakeMapTile(21, 2, 'oBrick');
143 MakeMapTile(22, 2, 'oBrick');
144 MakeMapTile(23, 2, 'oBrick');
145 MakeMapTile(24, 2, 'oBrick');
146 MakeMapTile(34, 2, 'oBrick');
147 MakeMapTile(35, 2, 'oBrick');
148 MakeMapTile(36, 2, 'oBrick');
149 MakeMapTile(37, 2, 'oRope');
150 MakeMapTile(38, 2, 'oBrick');
151 MakeMapTile(39, 2, 'oBrick');
152 MakeMapTileAtPix(592, 40, 'oRope');
153 MakeMapTile(0, 3, 'oBrick');
154 MakeMapTile(1, 3, 'oBrick');
155 MakeMapTile(2, 3, 'oBrick');
156 MakeMapTile(3, 3, 'oBrick');
157 MakeMapTile(4, 3, 'oBrick');
158 MakeMapTile(18, 3, 'oBrick');
159 MakeMapTile(19, 3, 'oBrick');
160 MakeMapTile(20, 3, 'oBrick');
161 MakeMapTile(21, 3, 'oBrick');
162 MakeMapTile(22, 3, 'oBrick');
163 MakeMapTile(23, 3, 'oBrick');
164 MakeMapTile(24, 3, 'oTitleBG');
165 MakeMapTile(35, 3, 'oBrick');
166 MakeMapTile(36, 3, 'oBrick');
167 MakeMapTile(37, 3, 'oRope');
168 MakeMapTile(38, 3, 'oBrick');
169 MakeMapTile(39, 3, 'oBrick');
170 MakeMapTileAtPix(592, 56, 'oRope');
171 MakeMapTile(0, 4, 'oBrick');
172 MakeMapTile(1, 4, 'oBrick');
173 MakeMapTile(2, 4, 'oBrick');
174 MakeMapTile(3, 4, 'oBrick');
175 MakeMapTile(18, 4, 'oBrick');
176 MakeMapTile(19, 4, 'oBrick');
177 MakeMapTile(20, 4, 'oBrick');
178 MakeMapTile(21, 4, 'oBrick');
179 MakeMapTile(22, 4, 'oBrick');
180 MakeMapTile(36, 4, 'oBrick');
181 MakeMapTile(37, 4, 'oRope');
182 MakeMapTile(38, 4, 'oBrick');
183 MakeMapTile(39, 4, 'oBrick');
184 MakeMapTileAtPix(592, 72, 'oRope');
185 MakeMapTile(0, 5, 'oBrick');
186 MakeMapTile(1, 5, 'oBrick');
187 MakeMapTile(18, 5, 'oBrick');
188 MakeMapTile(19, 5, 'oBrick');
189 MakeMapTile(20, 5, 'oBrick');
190 MakeMapTile(21, 5, 'oBrick');
191 MakeMapTile(26, 5, 'oTitleLogo');
192 MakeMapTile(37, 5, 'oRope');
193 MakeMapTile(38, 5, 'oBrick');
194 MakeMapTile(39, 5, 'oBrick');
195 MakeMapTileAtPix(592, 88, 'oRope');
196 MakeMapTile(0, 6, 'oBrick');
197 MakeMapTile(1, 6, 'oBrick');
198 MakeMapTile(37, 6, 'oRope');
199 MakeMapTile(38, 6, 'oBrick');
200 MakeMapTile(39, 6, 'oBrick');
201 MakeMapTileAtPix(592, 104, 'oRope');
202 MakeMapTile(0, 7, 'oBrick');
203 MakeMapTile(1, 7, 'oBrick');
204 MakeMapTile(4, 7, 'oLevel5Sign');
205 MakeMapTile(17, 7, 'oBrickSmooth');
206 MakeMapTile(18, 7, 'oBrickSmooth');
207 MakeMapTile(19, 7, 'oBrickSmooth');
208 MakeMapTile(20, 7, 'oBrick');
209 MakeMapTile(21, 7, 'oBrick');
210 MakeMapTile(37, 7, 'oRope');
211 MakeMapTile(38, 7, 'oBrick');
212 MakeMapTile(39, 7, 'oBrick');
213 MakeMapTileAtPix(592, 120, 'oRope');
214 MakeMapTile(0, 8, 'oBrick');
215 MakeMapTile(1, 8, 'oBrick');
216 MakeMapTile(5, 8, 'oXShortcut5');
217 MakeMapTile(16, 8, 'oBrickSmooth');
218 MakeMapTile(17, 8, 'oBrick');
219 MakeMapTile(18, 8, 'oBrick');
220 MakeMapTile(19, 8, 'oBrick');
221 MakeMapTile(20, 8, 'oBrick');
222 MakeMapTile(21, 8, 'oBrick');
223 MakeMapTileAtPix(440, 128, 'oStartSignBig');
224 MakeMapTile(37, 8, 'oRope');
225 MakeMapTile(38, 8, 'oBrick');
226 MakeMapTile(39, 8, 'oBrick');
227 MakeMapTileAtPix(592, 136, 'oRope');
228 MakeMapTile(0, 9, 'oBrick');
229 MakeMapTile(1, 9, 'oBrick');
230 MakeMapTile(2, 9, 'oBrickSmooth');
231 MakeMapTile(3, 9, 'oBrickSmooth');
232 MakeMapTile(4, 9, 'oBrickSmooth');
233 MakeMapTile(5, 9, 'oBrickSmooth');
234 MakeMapTile(6, 9, 'oBrickSmooth');
235 MakeMapTile(7, 9, 'oBrickSmooth');
236 MakeMapTile(8, 9, 'oBrickSmooth');
237 MakeMapTile(9, 9, 'oBrickSmooth');
238 MakeMapTile(10, 9, 'oBrickSmooth');
239 MakeMapTile(11, 9, 'oBrickSmooth');
240 MakeMapTile(12, 9, 'oBrickSmooth');
241 MakeMapTile(13, 9, 'oBrickSmooth');
242 MakeMapTile(14, 9, 'oBrickSmooth');
243 MakeMapTile(15, 9, 'oBrickSmooth');
244 MakeMapTile(16, 9, 'oBrick');
245 MakeMapTile(17, 9, 'oBrick');
246 MakeMapTile(18, 9, 'oBrick');
247 MakeMapTile(19, 9, 'oBrick');
248 MakeMapTile(20, 9, 'oBrick');
249 MakeMapTile(21, 9, 'oBrick');
250 MakeMapTile(37, 9, 'oRope');
251 MakeMapTile(38, 9, 'oBrick');
252 MakeMapTile(39, 9, 'oBrick');
253 MakeMapTileAtPix(592, 152, 'oRope');
254 MakeMapTile(0, 10, 'oBrick');
255 MakeMapTile(1, 10, 'oBrick');
256 MakeMapTile(2, 10, 'oBrick');
257 MakeMapTile(3, 10, 'oBrick');
258 MakeMapTile(4, 10, 'oBrick');
259 MakeMapTile(5, 10, 'oHardBlock');
260 MakeMapTile(6, 10, 'oHardBlock');
261 MakeMapTile(7, 10, 'oHardBlock');
262 MakeMapTile(8, 10, 'oHardBlock');
263 MakeMapTile(9, 10, 'oHardBlock');
264 MakeMapTile(10, 10, 'oHardBlock');
265 MakeMapTile(11, 10, 'oHardBlock');
266 MakeMapTile(12, 10, 'oHardBlock');
267 MakeMapTile(13, 10, 'oHardBlock');
268 MakeMapTile(14, 10, 'oBrick');
269 MakeMapTile(15, 10, 'oBrick');
270 MakeMapTile(16, 10, 'oBrick');
271 MakeMapTile(17, 10, 'oBrick');
272 MakeMapTile(18, 10, 'oBrick');
273 MakeMapTile(19, 10, 'oBrick');
274 MakeMapTile(20, 10, 'oTutorialSign');
275 MakeMapTile(24, 10, 'oScoresSign');
276 MakeMapTile(32, 10, 'oModeSign');
277 MakeMapTile(37, 10, 'oRope');
278 MakeMapTile(38, 10, 'oBrick');
279 MakeMapTile(39, 10, 'oBrick');
280 MakeMapTile(0, 11, 'oBrick');
281 MakeMapTile(1, 11, 'oBrick');
282 MakeMapTile(2, 11, 'oBrick');
283 MakeMapTile(3, 11, 'oBrick');
284 MakeMapTile(4, 11, 'oBrick');
285 MakeMapTile(5, 11, 'oBrick');
286 MakeMapTile(6, 11, 'oBrick');
287 MakeMapTile(7, 11, 'oBrick');
288 MakeMapTile(8, 11, 'oBrick');
289 MakeMapTile(9, 11, 'oBrick');
290 MakeMapTile(10, 11, 'oBrick');
291 MakeMapTile(11, 11, 'oBrick');
292 MakeMapTile(12, 11, 'oBrick');
293 MakeMapTile(13, 11, 'oBrick');
294 MakeMapTile(14, 11, 'oBrick');
295 MakeMapTile(15, 11, 'oBrick');
296 MakeMapTile(16, 11, 'oBrick');
297 MakeMapTile(17, 11, 'oBrick');
298 MakeMapTile(18, 11, 'oBrick');
299 MakeMapTile(19, 11, 'oBrick');
300 MakeMapTile(20, 11, 'oBrick');
301 MakeMapTile(21, 11, 'oXTutorial');
302 MakeMapTile(25, 11, 'oXScores');
303 MakeMapTile(33, 11, 'oXMode');
304 //!MakeMapTileAtPix(580, 176, 'oComputer');
305 MakeMapTile(38, 11, 'oBrick');
306 MakeMapTile(39, 11, 'oBrick');
307 MakeMapTile(0, 12, 'oBrick');
308 MakeMapTile(1, 12, 'oBrick');
309 MakeMapTile(2, 12, 'oBrick');
310 MakeMapTile(3, 12, 'oBrick');
311 MakeMapTile(4, 12, 'oBrick');
312 MakeMapTile(5, 12, 'oBrick');
313 MakeMapTile(6, 12, 'oBrick');
314 MakeMapTile(7, 12, 'oBrick');
315 MakeMapTile(8, 12, 'oBrick');
316 MakeMapTile(9, 12, 'oBrick');
317 MakeMapTile(10, 12, 'oBrick');
318 MakeMapTile(11, 12, 'oBrick');
319 MakeMapTile(12, 12, 'oBrick');
320 MakeMapTile(13, 12, 'oBrick');
321 MakeMapTile(14, 12, 'oBrick');
322 MakeMapTile(15, 12, 'oBrick');
323 MakeMapTile(16, 12, 'oBrick');
324 MakeMapTile(17, 12, 'oBrick');
325 MakeMapTile(18, 12, 'oBrick');
326 MakeMapTile(19, 12, 'oBrick');
327 MakeMapTile(20, 12, 'oBrick');
328 MakeMapTile(21, 12, 'oBrick');
329 MakeMapTile(22, 12, 'oBrick');
330 MakeMapTile(23, 12, 'oBrick');
331 MakeMapTile(24, 12, 'oHardBlock');
332 MakeMapTile(25, 12, 'oHardBlock');
333 MakeMapTile(26, 12, 'oHardBlock');
334 MakeMapTile(27, 12, 'oHardBlock');
335 MakeMapTile(28, 12, 'oHardBlock');
336 MakeMapTile(29, 12, 'oHardBlock');
337 MakeMapTile(30, 12, 'oHardBlock');
338 MakeMapTile(31, 12, 'oHardBlock');
339 MakeMapTile(32, 12, 'oHardBlock');
340 MakeMapTile(33, 12, 'oHardBlock');
341 MakeMapTile(34, 12, 'oHardBlock');
342 MakeMapTile(35, 12, 'oBrick');
343 MakeMapTile(36, 12, 'oBrick');
344 MakeMapTile(37, 12, 'oBrick');
345 MakeMapTile(38, 12, 'oBrick');
346 MakeMapTile(39, 12, 'oBrick');
347 MakeMapTile(0, 13, 'oBrick');
348 MakeMapTile(1, 13, 'oBrick');
349 MakeMapTile(2, 13, 'oBrick');
350 MakeMapTile(3, 13, 'oBrick');
351 MakeMapTile(4, 13, 'oBrick');
352 MakeMapTile(5, 13, 'oBrick');
353 MakeMapTile(6, 13, 'oBrick');
354 MakeMapTile(7, 13, 'oBrick');
355 MakeMapTile(8, 13, 'oBrick');
356 MakeMapTile(9, 13, 'oBrick');
357 MakeMapTile(10, 13, 'oBrick');
358 MakeMapTile(11, 13, 'oBrick');
359 MakeMapTile(12, 13, 'oBrick');
360 MakeMapTile(13, 13, 'oBrick');
361 MakeMapTile(14, 13, 'oBrick');
362 MakeMapTile(15, 13, 'oBrick');
363 MakeMapTile(16, 13, 'oBrick');
364 MakeMapTile(17, 13, 'oBrick');
365 MakeMapTile(18, 13, 'oBrick');
366 MakeMapTile(19, 13, 'oBrick');
367 MakeMapTile(20, 13, 'oBrick');
368 MakeMapTile(21, 13, 'oBrick');
369 MakeMapTile(22, 13, 'oBrick');
370 MakeMapTile(23, 13, 'oBrick');
371 MakeMapTile(24, 13, 'oBrick');
372 MakeMapTile(25, 13, 'oBrick');
373 MakeMapTile(26, 13, 'oBrick');
374 MakeMapTile(27, 13, 'oBrick');
375 MakeMapTile(28, 13, 'oBrick');
376 MakeMapTile(29, 13, 'oBrick');
377 MakeMapTile(30, 13, 'oBrick');
378 MakeMapTile(31, 13, 'oBrick');
379 MakeMapTile(32, 13, 'oBrick');
380 MakeMapTile(33, 13, 'oBrick');
381 MakeMapTile(34, 13, 'oBrick');
382 MakeMapTile(35, 13, 'oBrick');
383 MakeMapTile(36, 13, 'oBrick');
384 MakeMapTile(37, 13, 'oBrick');
385 MakeMapTile(38, 13, 'oBrick');
386 MakeMapTile(39, 13, 'oBrick');
387 MakeMapTile(0, 14, 'oBrick');
388 MakeMapTile(1, 14, 'oBrick');
389 MakeMapTile(2, 14, 'oBrick');
390 MakeMapTile(3, 14, 'oBrick');
391 MakeMapTile(4, 14, 'oBrick');
392 MakeMapTile(5, 14, 'oBrick');
393 MakeMapTile(6, 14, 'oBrick');
394 MakeMapTile(7, 14, 'oBrick');
395 MakeMapTile(8, 14, 'oBrick');
396 MakeMapTile(9, 14, 'oBrick');
397 MakeMapTile(10, 14, 'oBrick');
398 MakeMapTile(11, 14, 'oBrick');
399 MakeMapTile(12, 14, 'oBrick');
400 MakeMapTile(13, 14, 'oBrick');
401 MakeMapTile(14, 14, 'oBrick');
402 MakeMapTile(15, 14, 'oBrick');
403 MakeMapTile(16, 14, 'oBrick');
404 MakeMapTile(17, 14, 'oBrick');
405 MakeMapTile(18, 14, 'oBrick');
406 MakeMapTile(19, 14, 'oBrick');
407 MakeMapTile(20, 14, 'oBrick');
408 MakeMapTile(21, 14, 'oBrick');
409 MakeMapTile(22, 14, 'oBrick');
410 MakeMapTile(23, 14, 'oBrick');
411 MakeMapTile(24, 14, 'oBrick');
412 MakeMapTile(25, 14, 'oBrick');
413 MakeMapTile(26, 14, 'oBrick');
414 MakeMapTile(27, 14, 'oBrick');
415 MakeMapTile(28, 14, 'oBrick');
416 MakeMapTile(29, 14, 'oBrick');
417 MakeMapTile(30, 14, 'oBrick');
418 MakeMapTile(31, 14, 'oBrick');
419 MakeMapTile(32, 14, 'oBrick');
420 MakeMapTile(33, 14, 'oBrick');
421 MakeMapTile(34, 14, 'oBrick');
422 MakeMapTile(35, 14, 'oBrick');
423 MakeMapTile(36, 14, 'oBrick');
424 MakeMapTile(37, 14, 'oBrick');
425 MakeMapTile(38, 14, 'oBrick');
426 MakeMapTile(39, 14, 'oBrick');
427 MakeMapTileAtPix(388, 232, 'oCopy');
429 MakeMapTileAtPix(464-16, 176-32, 'oXStart');
431 MakeMapTileAtPix(128, 112, 'oLevel9Sign');
432 MakeMapTileAtPix(144, 128, 'oXShortcut9');
434 MakeMapTileAtPix(192, 112, 'oLevel13Sign');
435 MakeMapTileAtPix(208, 128, 'oXShortcut13');
437 if (global.config.scumUnlocked || stats.tunnel1Active || stats.tunnel2Active || stats.tunnel3Active) {
440 MakeMapTileAtPix(320, 96, 'oBrick');
441 MakeMapTileAtPix(336, 96, 'oBrick');
442 setRoomBounds(624-320+16, 0, 624, 232-16);
445 if (global.testChamberRevealed) {
446 MakeMapTileAtPix(512, 64, 'oXDebug');
448 MakeMapTileAtPix(512, 64, 'oTitleGlow');
451 spawnPlayerAt(320+280, 184);
452 player.dir = MapEntity::Dir.Left;
454 MakeMapObject(320+280, 188, 'oFlare');