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) {
37 if (door isa TitleTileXStars) {
42 if (door isa TitleTileXSun) {
47 if (door isa TitleTileXMoon) {
52 if (door isa TitleTileXChange) {
53 if (global.isDamsel) {
54 global.config.heroType = GameConfig::Hero.Spelunker;
56 global.config.heroType = GameConfig::Hero.Damsel;
63 void createTitleRoom () {
65 //global.darkLevel = true;
67 setRoomBounds(0, 0, 624, 232-16);
68 levBGImgName = 'bgCave';
69 //levBGImgName = 'sTitleBG';
71 //!MakeMapTile(7, 2, 'oGame');
72 //!MakeMapTile(8, 2, 'oBricks');
73 //!MakeMapTile(6, 2, 'oTitle');
75 MakeMapTile(0, 0, 'oBrick');
76 MakeMapTile(1, 0, 'oBrick');
77 MakeMapTile(2, 0, 'oBrick');
78 MakeMapTile(3, 0, 'oBrick');
79 MakeMapTile(4, 0, 'oBrick');
80 MakeMapTile(5, 0, 'oBrick');
81 MakeMapTile(6, 0, 'oBrick');
82 MakeMapTile(7, 0, 'oBrick');
83 MakeMapTile(8, 0, 'oBrick');
84 MakeMapTile(9, 0, 'oBrick');
85 MakeMapTile(10, 0, 'oBrick');
86 MakeMapTile(11, 0, 'oBrick');
87 MakeMapTile(12, 0, 'oBrick');
88 MakeMapTile(13, 0, 'oBrick');
89 MakeMapTile(14, 0, 'oBrick');
90 MakeMapTile(15, 0, 'oBrick');
91 MakeMapTile(16, 0, 'oBrick');
92 MakeMapTile(17, 0, 'oBrick');
93 MakeMapTile(18, 0, 'oBrick');
94 MakeMapTile(19, 0, 'oBrick');
95 MakeMapTile(20, 0, 'oBrick');
96 MakeMapTile(21, 0, 'oBrick');
97 MakeMapTile(22, 0, 'oBrick');
98 MakeMapTile(23, 0, 'oBrick');
99 MakeMapTile(24, 0, 'oBrick');
100 MakeMapTile(25, 0, 'oBrick');
101 MakeMapTile(26, 0, 'oBrick');
102 MakeMapTile(27, 0, 'oBrick');
103 MakeMapTile(28, 0, 'oBrick');
104 MakeMapTile(29, 0, 'oBrick');
105 MakeMapTile(30, 0, 'oBrick');
106 MakeMapTile(31, 0, 'oBrick');
107 MakeMapTile(32, 0, 'oBrick');
108 MakeMapTile(33, 0, 'oBrick');
109 MakeMapTile(34, 0, 'oBrick');
110 MakeMapTile(35, 0, 'oBrick');
111 MakeMapTile(36, 0, 'oBrick');
112 MakeMapTile(37, 0, 'oRope');
113 MakeMapTile(38, 0, 'oBrick');
114 MakeMapTile(39, 0, 'oBrick');
115 MakeMapTileAtPix(592, 8, 'oRope');
116 MakeMapTile(0, 1, 'oBrick');
117 MakeMapTile(1, 1, 'oBrick');
118 MakeMapTile(2, 1, 'oBrick');
119 MakeMapTile(3, 1, 'oBrick');
120 MakeMapTile(4, 1, 'oBrick');
121 MakeMapTile(5, 1, 'oBrick');
122 MakeMapTile(6, 1, 'oBrick');
123 MakeMapTile(7, 1, 'oBrick');
124 MakeMapTile(8, 1, 'oBrick');
125 MakeMapTile(9, 1, 'oBrick');
126 MakeMapTile(10, 1, 'oBrick');
127 MakeMapTile(11, 1, 'oBrick');
128 MakeMapTile(12, 1, 'oBrick');
129 MakeMapTile(13, 1, 'oBrick');
130 MakeMapTile(14, 1, 'oBrick');
131 MakeMapTile(15, 1, 'oBrick');
132 MakeMapTile(16, 1, 'oBrick');
133 MakeMapTile(17, 1, 'oBrick');
134 MakeMapTile(18, 1, 'oBrick');
135 MakeMapTile(19, 1, 'oBrick');
136 MakeMapTile(20, 1, 'oBrick');
137 MakeMapTile(21, 1, 'oBrick');
138 MakeMapTile(22, 1, 'oBrick');
139 MakeMapTile(23, 1, 'oBrick');
140 MakeMapTile(24, 1, 'oBrick');
141 MakeMapTile(25, 1, 'oBrick');
142 MakeMapTile(26, 1, 'oBrick');
143 MakeMapTile(27, 1, 'oBrick');
144 MakeMapTile(28, 1, 'oBrick');
145 MakeMapTile(29, 1, 'oBrick');
146 MakeMapTile(30, 1, 'oBrick');
147 MakeMapTile(31, 1, 'oBrick');
148 MakeMapTile(32, 1, 'oBrick');
149 MakeMapTile(33, 1, 'oBrick');
150 MakeMapTile(34, 1, 'oBrick');
151 MakeMapTile(35, 1, 'oQuitSign');
152 MakeMapTile(37, 1, 'oRope');
153 MakeMapTile(38, 1, 'oBrick');
154 MakeMapTile(39, 1, 'oBrick');
155 MakeMapTileAtPix(592, 24, 'oRope');
156 MakeMapTile(0, 2, 'oBrick');
157 MakeMapTile(1, 2, 'oBrick');
158 MakeMapTile(2, 2, 'oBrick');
159 MakeMapTile(3, 2, 'oBrick');
160 MakeMapTile(4, 2, 'oBrick');
161 MakeMapTile(5, 2, 'oBrick');
162 MakeMapTile(17, 2, 'oBrick');
163 MakeMapTile(18, 2, 'oBrick');
164 MakeMapTile(19, 2, 'oBrick');
165 MakeMapTile(20, 2, 'oBrick');
166 MakeMapTile(21, 2, 'oBrick');
167 MakeMapTile(22, 2, 'oBrick');
168 MakeMapTile(23, 2, 'oBrick');
169 MakeMapTile(24, 2, 'oBrick');
170 MakeMapTile(34, 2, 'oBrick');
171 MakeMapTile(35, 2, 'oBrick');
172 MakeMapTile(36, 2, 'oBrick');
173 MakeMapTile(37, 2, 'oRope');
174 MakeMapTile(38, 2, 'oBrick');
175 MakeMapTile(39, 2, 'oBrick');
176 MakeMapTileAtPix(592, 40, 'oRope');
177 MakeMapTile(0, 3, 'oBrick');
178 MakeMapTile(1, 3, 'oBrick');
179 MakeMapTile(2, 3, 'oBrick');
180 MakeMapTile(3, 3, 'oBrick');
181 MakeMapTile(4, 3, 'oBrick');
182 MakeMapTile(18, 3, 'oBrick');
183 MakeMapTile(19, 3, 'oBrick');
184 MakeMapTile(20, 3, 'oBrick');
185 MakeMapTile(21, 3, 'oBrick');
186 MakeMapTile(22, 3, 'oBrick');
187 MakeMapTile(23, 3, 'oBrick');
188 MakeMapTile(24, 3, 'oTitleBG');
189 MakeMapTile(35, 3, 'oBrick');
190 MakeMapTile(36, 3, 'oBrick');
191 MakeMapTile(37, 3, 'oRope');
192 MakeMapTile(38, 3, 'oBrick');
193 MakeMapTile(39, 3, 'oBrick');
194 MakeMapTileAtPix(592, 56, 'oRope');
195 MakeMapTile(0, 4, 'oBrick');
196 MakeMapTile(1, 4, 'oBrick');
197 MakeMapTile(2, 4, 'oBrick');
198 MakeMapTile(3, 4, 'oBrick');
199 MakeMapTile(18, 4, 'oBrick');
200 MakeMapTile(19, 4, 'oBrick');
201 MakeMapTile(20, 4, 'oBrick');
202 MakeMapTile(21, 4, 'oBrick');
203 MakeMapTile(22, 4, 'oBrick');
204 MakeMapTile(36, 4, 'oBrick');
205 MakeMapTile(37, 4, 'oRope');
206 MakeMapTile(38, 4, 'oBrick');
207 MakeMapTile(39, 4, 'oBrick');
208 MakeMapTileAtPix(592, 72, 'oRope');
209 MakeMapTile(0, 5, 'oBrick');
210 MakeMapTile(1, 5, 'oBrick');
211 MakeMapTile(18, 5, 'oBrick');
212 MakeMapTile(19, 5, 'oBrick');
213 MakeMapTile(20, 5, 'oBrick');
214 MakeMapTile(21, 5, 'oBrick');
215 MakeMapTile(26, 5, 'oTitleLogo');
216 MakeMapTile(37, 5, 'oRope');
217 MakeMapTile(38, 5, 'oBrick');
218 MakeMapTile(39, 5, 'oBrick');
219 MakeMapTileAtPix(592, 88, 'oRope');
220 MakeMapTile(0, 6, 'oBrick');
221 MakeMapTile(1, 6, 'oBrick');
222 MakeMapTile(37, 6, 'oRope');
223 MakeMapTile(38, 6, 'oBrick');
224 MakeMapTile(39, 6, 'oBrick');
225 MakeMapTileAtPix(592, 104, 'oRope');
226 MakeMapTile(0, 7, 'oBrick');
227 MakeMapTile(1, 7, 'oBrick');
228 MakeMapTile(4, 7, 'oLevel5Sign');
229 MakeMapTile(17, 7, 'oBrickSmooth');
230 MakeMapTile(18, 7, 'oBrickSmooth');
231 MakeMapTile(19, 7, 'oBrickSmooth');
232 MakeMapTile(20, 7, 'oBrick');
233 MakeMapTile(21, 7, 'oBrick');
234 MakeMapTile(37, 7, 'oRope');
235 MakeMapTile(38, 7, 'oBrick');
236 MakeMapTile(39, 7, 'oBrick');
237 MakeMapTileAtPix(592, 120, 'oRope');
238 MakeMapTile(0, 8, 'oBrick');
239 MakeMapTile(1, 8, 'oBrick');
240 MakeMapTile(5, 8, 'oXShortcut5');
241 MakeMapTile(16, 8, 'oBrickSmooth');
242 MakeMapTile(17, 8, 'oBrick');
243 MakeMapTile(18, 8, 'oBrick');
244 MakeMapTile(19, 8, 'oBrick');
245 MakeMapTile(20, 8, 'oBrick');
246 MakeMapTile(21, 8, 'oBrick');
247 MakeMapTileAtPix(440, 128, 'oStartSignBig');
248 MakeMapTile(37, 8, 'oRope');
249 MakeMapTile(38, 8, 'oBrick');
250 MakeMapTile(39, 8, 'oBrick');
251 MakeMapTileAtPix(592, 136, 'oRope');
252 MakeMapTile(0, 9, 'oBrick');
253 MakeMapTile(1, 9, 'oBrick');
254 MakeMapTile(2, 9, 'oBrickSmooth');
255 MakeMapTile(3, 9, 'oBrickSmooth');
256 MakeMapTile(4, 9, 'oBrickSmooth');
257 MakeMapTile(5, 9, 'oBrickSmooth');
258 MakeMapTile(6, 9, 'oBrickSmooth');
259 MakeMapTile(7, 9, 'oBrickSmooth');
260 MakeMapTile(8, 9, 'oBrickSmooth');
261 MakeMapTile(9, 9, 'oBrickSmooth');
262 MakeMapTile(10, 9, 'oBrickSmooth');
263 MakeMapTile(11, 9, 'oBrickSmooth');
264 MakeMapTile(12, 9, 'oBrickSmooth');
265 MakeMapTile(13, 9, 'oBrickSmooth');
266 MakeMapTile(14, 9, 'oBrickSmooth');
267 MakeMapTile(15, 9, 'oBrickSmooth');
268 MakeMapTile(16, 9, 'oBrick');
269 MakeMapTile(17, 9, 'oBrick');
270 MakeMapTile(18, 9, 'oBrick');
271 MakeMapTile(19, 9, 'oBrick');
272 MakeMapTile(20, 9, 'oBrick');
273 MakeMapTile(21, 9, 'oBrick');
274 MakeMapTile(37, 9, 'oRope');
275 MakeMapTile(38, 9, 'oBrick');
276 MakeMapTile(39, 9, 'oBrick');
277 MakeMapTileAtPix(592, 152, 'oRope');
278 MakeMapTile(0, 10, 'oBrick');
279 MakeMapTile(1, 10, 'oBrick');
280 MakeMapTile(2, 10, 'oBrick');
281 MakeMapTile(3, 10, 'oBrick');
282 MakeMapTile(4, 10, 'oBrick');
283 MakeMapTile(5, 10, 'oHardBlock');
284 MakeMapTile(6, 10, 'oHardBlock');
285 MakeMapTile(7, 10, 'oHardBlock');
286 MakeMapTile(8, 10, 'oHardBlock');
287 MakeMapTile(9, 10, 'oHardBlock');
288 MakeMapTile(10, 10, 'oHardBlock');
289 MakeMapTile(11, 10, 'oHardBlock');
290 MakeMapTile(12, 10, 'oHardBlock');
291 MakeMapTile(13, 10, 'oHardBlock');
292 MakeMapTile(14, 10, 'oBrick');
293 MakeMapTile(15, 10, 'oBrick');
294 MakeMapTile(16, 10, 'oBrick');
295 MakeMapTile(17, 10, 'oBrick');
296 MakeMapTile(18, 10, 'oBrick');
297 MakeMapTile(19, 10, 'oBrick');
298 MakeMapTile(20, 10, 'oTutorialSign');
299 MakeMapTile(24, 10, 'oScoresSign');
300 MakeMapTile(32, 10, 'oModeSign');
301 MakeMapTile(37, 10, 'oRope');
302 MakeMapTile(38, 10, 'oBrick');
303 MakeMapTile(39, 10, 'oBrick');
304 MakeMapTile(0, 11, 'oBrick');
305 MakeMapTile(1, 11, 'oBrick');
306 MakeMapTile(2, 11, 'oBrick');
307 MakeMapTile(3, 11, 'oBrick');
308 MakeMapTile(4, 11, 'oBrick');
309 MakeMapTile(5, 11, 'oBrick');
310 MakeMapTile(6, 11, 'oBrick');
311 MakeMapTile(7, 11, 'oBrick');
312 MakeMapTile(8, 11, 'oBrick');
313 MakeMapTile(9, 11, 'oBrick');
314 MakeMapTile(10, 11, 'oBrick');
315 MakeMapTile(11, 11, 'oBrick');
316 MakeMapTile(12, 11, 'oBrick');
317 MakeMapTile(13, 11, 'oBrick');
318 MakeMapTile(14, 11, 'oBrick');
319 MakeMapTile(15, 11, 'oBrick');
320 MakeMapTile(16, 11, 'oBrick');
321 MakeMapTile(17, 11, 'oBrick');
322 MakeMapTile(18, 11, 'oBrick');
323 MakeMapTile(19, 11, 'oBrick');
324 MakeMapTile(20, 11, 'oBrick');
325 MakeMapTile(21, 11, 'oXTutorial');
326 MakeMapTile(25, 11, 'oXScores');
327 MakeMapTile(33, 11, 'oXMode');
328 //!MakeMapTileAtPix(580, 176, 'oComputer');
329 MakeMapTile(38, 11, 'oBrick');
330 MakeMapTile(39, 11, 'oBrick');
331 MakeMapTile(0, 12, 'oBrick');
332 MakeMapTile(1, 12, 'oBrick');
333 MakeMapTile(2, 12, 'oBrick');
334 MakeMapTile(3, 12, 'oBrick');
335 MakeMapTile(4, 12, 'oBrick');
336 MakeMapTile(5, 12, 'oBrick');
337 MakeMapTile(6, 12, 'oBrick');
338 MakeMapTile(7, 12, 'oBrick');
339 MakeMapTile(8, 12, 'oBrick');
340 MakeMapTile(9, 12, 'oBrick');
341 MakeMapTile(10, 12, 'oBrick');
342 MakeMapTile(11, 12, 'oBrick');
343 MakeMapTile(12, 12, 'oBrick');
344 MakeMapTile(13, 12, 'oBrick');
345 MakeMapTile(14, 12, 'oBrick');
346 MakeMapTile(15, 12, 'oBrick');
347 MakeMapTile(16, 12, 'oBrick');
348 MakeMapTile(17, 12, 'oBrick');
349 MakeMapTile(18, 12, 'oBrick');
350 MakeMapTile(19, 12, 'oBrick');
351 MakeMapTile(20, 12, 'oBrick');
352 MakeMapTile(21, 12, 'oBrick');
353 MakeMapTile(22, 12, 'oBrick');
354 MakeMapTile(23, 12, 'oBrick');
355 MakeMapTile(24, 12, 'oHardBlock');
356 MakeMapTile(25, 12, 'oHardBlock');
357 MakeMapTile(26, 12, 'oHardBlock');
358 MakeMapTile(27, 12, 'oHardBlock');
359 MakeMapTile(28, 12, 'oHardBlock');
360 MakeMapTile(29, 12, 'oHardBlock');
361 MakeMapTile(30, 12, 'oHardBlock');
362 MakeMapTile(31, 12, 'oHardBlock');
363 MakeMapTile(32, 12, 'oHardBlock');
364 MakeMapTile(33, 12, 'oHardBlock');
365 MakeMapTile(34, 12, 'oHardBlock');
366 MakeMapTile(35, 12, 'oBrick');
367 MakeMapTile(36, 12, 'oBrick');
368 MakeMapTile(37, 12, 'oBrick');
369 MakeMapTile(38, 12, 'oBrick');
370 MakeMapTile(39, 12, 'oBrick');
371 MakeMapTile(0, 13, 'oBrick');
372 MakeMapTile(1, 13, 'oBrick');
373 MakeMapTile(2, 13, 'oBrick');
374 MakeMapTile(3, 13, 'oBrick');
375 MakeMapTile(4, 13, 'oBrick');
376 MakeMapTile(5, 13, 'oBrick');
377 MakeMapTile(6, 13, 'oBrick');
378 MakeMapTile(7, 13, 'oBrick');
379 MakeMapTile(8, 13, 'oBrick');
380 MakeMapTile(9, 13, 'oBrick');
381 MakeMapTile(10, 13, 'oBrick');
382 MakeMapTile(11, 13, 'oBrick');
383 MakeMapTile(12, 13, 'oBrick');
384 MakeMapTile(13, 13, 'oBrick');
385 MakeMapTile(14, 13, 'oBrick');
386 MakeMapTile(15, 13, 'oBrick');
387 MakeMapTile(16, 13, 'oBrick');
388 MakeMapTile(17, 13, 'oBrick');
389 MakeMapTile(18, 13, 'oBrick');
390 MakeMapTile(19, 13, 'oBrick');
391 MakeMapTile(20, 13, 'oBrick');
392 MakeMapTile(21, 13, 'oBrick');
393 MakeMapTile(22, 13, 'oBrick');
394 MakeMapTile(23, 13, 'oBrick');
395 MakeMapTile(24, 13, 'oBrick');
396 MakeMapTile(25, 13, 'oBrick');
397 MakeMapTile(26, 13, 'oBrick');
398 MakeMapTile(27, 13, 'oBrick');
399 MakeMapTile(28, 13, 'oBrick');
400 MakeMapTile(29, 13, 'oBrick');
401 MakeMapTile(30, 13, 'oBrick');
402 MakeMapTile(31, 13, 'oBrick');
403 MakeMapTile(32, 13, 'oBrick');
404 MakeMapTile(33, 13, 'oBrick');
405 MakeMapTile(34, 13, 'oBrick');
406 MakeMapTile(35, 13, 'oBrick');
407 MakeMapTile(36, 13, 'oBrick');
408 MakeMapTile(37, 13, 'oBrick');
409 MakeMapTile(38, 13, 'oBrick');
410 MakeMapTile(39, 13, 'oBrick');
411 MakeMapTile(0, 14, 'oBrick');
412 MakeMapTile(1, 14, 'oBrick');
413 MakeMapTile(2, 14, 'oBrick');
414 MakeMapTile(3, 14, 'oBrick');
415 MakeMapTile(4, 14, 'oBrick');
416 MakeMapTile(5, 14, 'oBrick');
417 MakeMapTile(6, 14, 'oBrick');
418 MakeMapTile(7, 14, 'oBrick');
419 MakeMapTile(8, 14, 'oBrick');
420 MakeMapTile(9, 14, 'oBrick');
421 MakeMapTile(10, 14, 'oBrick');
422 MakeMapTile(11, 14, 'oBrick');
423 MakeMapTile(12, 14, 'oBrick');
424 MakeMapTile(13, 14, 'oBrick');
425 MakeMapTile(14, 14, 'oBrick');
426 MakeMapTile(15, 14, 'oBrick');
427 MakeMapTile(16, 14, 'oBrick');
428 MakeMapTile(17, 14, 'oBrick');
429 MakeMapTile(18, 14, 'oBrick');
430 MakeMapTile(19, 14, 'oBrick');
431 MakeMapTile(20, 14, 'oBrick');
432 MakeMapTile(21, 14, 'oBrick');
433 MakeMapTile(22, 14, 'oBrick');
434 MakeMapTile(23, 14, 'oBrick');
435 MakeMapTile(24, 14, 'oBrick');
436 MakeMapTile(25, 14, 'oBrick');
437 MakeMapTile(26, 14, 'oBrick');
438 MakeMapTile(27, 14, 'oBrick');
439 MakeMapTile(28, 14, 'oBrick');
440 MakeMapTile(29, 14, 'oBrick');
441 MakeMapTile(30, 14, 'oBrick');
442 MakeMapTile(31, 14, 'oBrick');
443 MakeMapTile(32, 14, 'oBrick');
444 MakeMapTile(33, 14, 'oBrick');
445 MakeMapTile(34, 14, 'oBrick');
446 MakeMapTile(35, 14, 'oBrick');
447 MakeMapTile(36, 14, 'oBrick');
448 MakeMapTile(37, 14, 'oBrick');
449 MakeMapTile(38, 14, 'oBrick');
450 MakeMapTile(39, 14, 'oBrick');
451 MakeMapTileAtPix(388, 232, 'oCopy');
453 MakeMapTileAtPix(464-16, 176-32, 'oXStart');
455 MakeMapTileAtPix(128, 112, 'oLevel9Sign');
456 MakeMapTileAtPix(144, 128, 'oXShortcut9');
458 MakeMapTileAtPix(192, 112, 'oLevel13Sign');
459 MakeMapTileAtPix(208, 128, 'oXShortcut13');
461 if (global.config.scumUnlocked || stats.tunnel1Active || stats.tunnel2Active || stats.tunnel3Active) {
463 setRoomBounds(624-320+16, 0, 624, 232-16);
465 MakeMapTileAtPix(320, 96, 'oBrick');
466 MakeMapTileAtPix(336, 96, 'oBrick');
467 setRoomBounds(624-320+16, 0, 624, 232-16);
470 if (global.testChamberRevealed) {
471 MakeMapTileAtPix(512, 64, 'oXDebug');
473 MakeMapTileAtPix(512, 64, 'oTitleGlow');
476 spawnPlayerAt(320+280, 184);
477 player.dir = MapEntity::Dir.Left;
479 MakeMapObject(320+280, 188, 'oFlare');