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