layout.lua 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953
  1. --[========================================================================[--
  2. Map and ancillary data for Thrust II Reloaded.
  3. Copyright © 2015-2018 Pedro Gimeno Fortea
  4. Permission is hereby granted, free of charge, to any person obtaining a copy
  5. of this software and associated documentation files (the "Software"), to deal
  6. in the Software without restriction, including without limitation the rights
  7. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. copies of the Software, and to permit persons to whom the Software is
  9. furnished to do so, subject to the following conditions:
  10. The above copyright notice and this permission notice shall be included in
  11. all copies or substantial portions of the Software.
  12. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  18. SOFTWARE.
  19. --]========================================================================]--
  20. local map = {}
  21. local la,le,lfs,lf,lg,li,lj,lk,lm,lmo,lp,ls,lsys,lth,lt,lw = require'ns'()
  22. do
  23. local found = false
  24. local i = 0
  25. for line in lfs.lines('tilesets/ThrustIIgen4.tmx') do
  26. if found then
  27. if line == '</data>' then
  28. break
  29. end
  30. for match in line:gmatch('[^%n,]+') do
  31. i = i + 1
  32. map[i] = tonumber(match)
  33. end
  34. elseif line:find('<data encoding="csv">', 0, true) then
  35. found = true
  36. end
  37. end
  38. end
  39. local enemytypes = {
  40. -- they are defined in order of sprites
  41. { -- type 1
  42. width = 1, -- number of consecutive tiles to draw
  43. height = 1, -- first all width tiles are drawn before skipping to the next
  44. -- height tile
  45. nframes = 8 , -- number of consecutive sprites in sprite image
  46. pingpong = true, -- animation pingpong
  47. -- implies a pause at the endpoints
  48. },
  49. { -- type 2
  50. width = 1,
  51. height = 1,
  52. nframes = 8,
  53. pingpong = false,
  54. },
  55. { -- type 3
  56. width = 1,
  57. height = 1,
  58. nframes = 8,
  59. pingpong = false,
  60. },
  61. { -- type 4
  62. width = 1,
  63. height = 1,
  64. nframes = 8,
  65. pingpong = false,
  66. },
  67. { -- type 5
  68. width = 1,
  69. height = 1,
  70. nframes = 8,
  71. pingpong = true,
  72. },
  73. { -- type 6
  74. width = 1,
  75. height = 1,
  76. nframes = 8,
  77. pingpong = true,
  78. },
  79. { -- type 7
  80. width = 2,
  81. height = 1,
  82. nframes = 8,
  83. pingpong = true,
  84. },
  85. { -- type = 8
  86. width = 2,
  87. height = 1,
  88. nframes = 8,
  89. pingpong = false,
  90. },
  91. }
  92. local enemies = {
  93. {
  94. type = 8,
  95. x0 = 206, y0 = 834, -- from coordinates
  96. x1 = 206, y1 = 914, -- to coordinates
  97. period = 5, -- total time to move (seconds)
  98. t = 2.25, -- starting/current instant in time
  99. frame = 4, -- starting/current frame
  100. fps = 16, -- animation fps
  101. },
  102. {
  103. type = 8,
  104. x0 = 2766, y0 = 1198,
  105. x1 = 2766, y1 = 1262,
  106. period = 4,
  107. t = 0.125,
  108. frame = 2,
  109. fps = 16,
  110. },
  111. {
  112. type = 8,
  113. x0 = 702, y0 = 1414,
  114. x1 = 702, y1 = 1494,
  115. period = 5,
  116. t = 1.75,
  117. frame = 4,
  118. fps = 16,
  119. },
  120. {
  121. type = 8,
  122. x0 = 3566, y0 = 1718,
  123. x1 = 3566, y1 = 1782,
  124. period = 4,
  125. t = 0.1875,
  126. frame = 3,
  127. fps = 16,
  128. },
  129. {
  130. type = 8,
  131. x0 = 3582, y0 = 836,
  132. x1 = 3582, y1 = 916,
  133. period = 5,
  134. t = 1.875,
  135. frame = 6,
  136. fps = 16,
  137. },
  138. {
  139. type = 8,
  140. x0 = 3086, y0 = 724,
  141. x1 = 3086, y1 = 788,
  142. period = 4,
  143. t = 1.1875,
  144. frame = 3,
  145. fps = 16,
  146. },
  147. {
  148. type = 8,
  149. x0 = 1870, y0 = 1156,
  150. x1 = 1870, y1 = 1236,
  151. period = 5,
  152. t = 0.5625,
  153. frame = 1,
  154. fps = 16,
  155. },
  156. {
  157. type = 8,
  158. x0 = 1694, y0 = 1796,
  159. x1 = 1694, y1 = 1876,
  160. period = 5,
  161. t = 0.3125,
  162. frame = 5,
  163. fps = 16,
  164. },
  165. {
  166. type = 3,
  167. x0 = 2848, y0 = 1804,
  168. x1 = 2848, y1 = 1852,
  169. period = 3,
  170. t = 1.375,
  171. frame = 6,
  172. fps = 16,
  173. },
  174. {
  175. type = 3,
  176. x0 = 1472, y0 = 1162,
  177. x1 = 1472, y1 = 1242,
  178. period = 5,
  179. t = 1.625,
  180. frame = 2,
  181. fps = 16,
  182. },
  183. {
  184. type = 3,
  185. x0 = 2912, y0 = 912,
  186. x1 = 2912, y1 = 1024,
  187. period = 7,
  188. t = 1.5,
  189. frame = 0,
  190. fps = 16,
  191. },
  192. {
  193. type = 3,
  194. x0 = 2448, y0 = 1168,
  195. x1 = 2448, y1 = 1248,
  196. period = 5,
  197. t = 2.1875,
  198. frame = 3,
  199. fps = 16,
  200. },
  201. {
  202. type = 3,
  203. x0 = 1104, y0 = 776,
  204. x1 = 1104, y1 = 920,
  205. period = 9,
  206. t = 1.375,
  207. frame = 6,
  208. fps = 16,
  209. },
  210. {
  211. type = 3,
  212. x0 = 384, y0 = 1216,
  213. x1 = 384, y1 = 1312,
  214. period = 6,
  215. t = 1,
  216. frame = 0,
  217. fps = 16,
  218. },
  219. {
  220. type = 3,
  221. x0 = 1312, y0 = 1548,
  222. x1 = 1312, y1 = 1628,
  223. period = 5,
  224. t = 2.125,
  225. frame = 2,
  226. fps = 16,
  227. },
  228. {
  229. type = 3,
  230. x0 = 176, y0 = 1812,
  231. x1 = 176, y1 = 1876,
  232. period = 4,
  233. t = 1.5,
  234. frame = 0,
  235. fps = 16,
  236. },
  237. {
  238. type = 2,
  239. x0 = 4064, y0 = 844,
  240. x1 = 4064, y1 = 908,
  241. period = 4,
  242. t = 1.875,
  243. frame = 6,
  244. fps = 16,
  245. },
  246. {
  247. type = 2,
  248. x0 = 1376, y0 = 968,
  249. x1 = 1376, y1 = 1048,
  250. period = 5,
  251. t = 2.3125,
  252. frame = 5,
  253. fps = 16,
  254. },
  255. {
  256. type = 2,
  257. x0 = 4000, y0 = 1744,
  258. x1 = 4000, y1 = 1888,
  259. period = 9,
  260. t = 3.3125,
  261. frame = 5,
  262. fps = 16,
  263. },
  264. {
  265. type = 2,
  266. x0 = 928, y0 = 1292,
  267. x1 = 928, y1 = 1356,
  268. period = 4,
  269. t = 1.125,
  270. frame = 2,
  271. fps = 16,
  272. },
  273. {
  274. type = 2,
  275. x0 = 2208, y0 = 590,
  276. x1 = 2208, y1 = 734,
  277. period = 9,
  278. t = 3.3125,
  279. frame = 5,
  280. fps = 16,
  281. },
  282. {
  283. type = 2,
  284. x0 = 2448, y0 = 1548,
  285. x1 = 2448, y1 = 1708,
  286. period = 10,
  287. t = 3.6875,
  288. frame = 3,
  289. fps = 16,
  290. },
  291. {
  292. type = 2,
  293. x0 = 1504, y0 = 1352,
  294. x1 = 1504, y1 = 1512,
  295. period = 10,
  296. t = 0.75,
  297. frame = 4,
  298. fps = 16,
  299. },
  300. {
  301. type = 2,
  302. x0 = 544, y0 = 1802,
  303. x1 = 544, y1 = 1882,
  304. period = 5,
  305. t = 1.5625,
  306. frame = 1,
  307. fps = 16,
  308. },
  309. {
  310. type = 4,
  311. x0 = 912, y0 = 918,
  312. x1 = 912, y1 = 982,
  313. period = 4,
  314. t = 0.6875,
  315. frame = 3,
  316. fps = 16,
  317. },
  318. {
  319. type = 4,
  320. x0 = 2992, y0 = 1552,
  321. x1 = 2992, y1 = 1600,
  322. period = 3,
  323. t = 1.0625,
  324. frame = 1,
  325. fps = 16,
  326. },
  327. {
  328. type = 4,
  329. x0 = 2816, y0 = 930,
  330. x1 = 2816, y1 = 994,
  331. period = 4,
  332. t = 1.3125,
  333. frame = 5,
  334. fps = 16,
  335. },
  336. {
  337. type = 4,
  338. x0 = 544, y0 = 1216,
  339. x1 = 544, y1 = 1296,
  340. period = 5,
  341. t = 1.8125,
  342. frame = 5,
  343. fps = 16,
  344. },
  345. {
  346. type = 4,
  347. x0 = 3776, y0 = 1800,
  348. x1 = 3776, y1 = 1864,
  349. period = 4,
  350. t = 1.25,
  351. frame = 4,
  352. fps = 16,
  353. },
  354. {
  355. type = 4,
  356. x0 = 3632, y0 = 652,
  357. x1 = 3632, y1 = 732,
  358. period = 5,
  359. t = 1.625,
  360. frame = 2,
  361. fps = 16,
  362. },
  363. {
  364. type = 4,
  365. x0 = 2208, y0 = 1164,
  366. x1 = 2208, y1 = 1244,
  367. period = 5,
  368. t = 0.6875,
  369. frame = 3,
  370. fps = 16,
  371. },
  372. {
  373. type = 4,
  374. x0 = 1008, y0 = 1676,
  375. x1 = 1008, y1 = 1740,
  376. period = 4,
  377. t = 1.1875,
  378. frame = 3,
  379. fps = 16,
  380. },
  381. {
  382. type = 1,
  383. x0 = 1936, y0 = 1686,
  384. x1 = 2030, y1 = 1686,
  385. period = 6,
  386. t = 0.5625,
  387. frame = 6,
  388. fps = 16,
  389. },
  390. {
  391. type = 1,
  392. x0 = 688, y0 = 1760,
  393. x1 = 846, y1 = 1760,
  394. period = 10,
  395. t = 2.0625,
  396. frame = 6,
  397. fps = 16,
  398. },
  399. {
  400. type = 1,
  401. x0 = 3472, y0 = 1354,
  402. x1 = 3550, y1 = 1354,
  403. period = 5,
  404. t = 0,
  405. frame = 0,
  406. fps = 16,
  407. },
  408. {
  409. type = 1,
  410. x0 = 3840, y0 = 1120,
  411. x1 = 3934, y1 = 1120,
  412. period = 6,
  413. t = 2,
  414. frame = 7,
  415. fps = 16,
  416. },
  417. {
  418. type = 1,
  419. x0 = 3840, y0 = 774,
  420. x1 = 3902, y1 = 774,
  421. period = 4,
  422. t = 1.5,
  423. frame = 7,
  424. fps = 16,
  425. },
  426. {
  427. type = 1,
  428. x0 = 3200, y0 = 864,
  429. x1 = 3358, y1 = 864,
  430. period = 10,
  431. t = 3.4375,
  432. frame = 7,
  433. fps = 16,
  434. },
  435. {
  436. type = 1,
  437. x0 = 2944, y0 = 1188,
  438. x1 = 3038, y1 = 1188,
  439. period = 6,
  440. t = 0.8125,
  441. frame = 2,
  442. fps = 16,
  443. },
  444. {
  445. type = 1,
  446. x0 = 3072, y0 = 1886,
  447. x1 = 3230, y1 = 1886,
  448. period = 10,
  449. t = 3.0625,
  450. frame = 6,
  451. fps = 16,
  452. },
  453. {
  454. type = 5,
  455. x0 = 416, y0 = 782,
  456. x1 = 558, y1 = 782,
  457. period = 9,
  458. t = 3.0625,
  459. frame = 1,
  460. fps = 16,
  461. },
  462. {
  463. type = 5,
  464. x0 = 2080, y0 = 1504,
  465. x1 = 2238, y1 = 1504,
  466. period = 10,
  467. t = 4.75,
  468. frame = 4,
  469. fps = 16,
  470. },
  471. {
  472. type = 5,
  473. x0 = 784, y0 = 1376,
  474. x1 = 862, y1 = 1376,
  475. period = 5,
  476. t = 1.625,
  477. frame = 2,
  478. fps = 16,
  479. },
  480. {
  481. type = 5,
  482. x0 = 2560, y0 = 654,
  483. x1 = 2718, y1 = 654,
  484. period = 10,
  485. t = 1.875,
  486. frame = 1,
  487. fps = 16,
  488. },
  489. {
  490. type = 5,
  491. x0 = 3856, y0 = 1248,
  492. x1 = 3934, y1 = 1248,
  493. period = 5,
  494. t = 1.875,
  495. frame = 6,
  496. fps = 16,
  497. },
  498. {
  499. type = 5,
  500. x0 = 1344, y0 = 778,
  501. x1 = 1502, y1 = 778,
  502. period = 10,
  503. t = 2.1875,
  504. frame = 3,
  505. fps = 16,
  506. },
  507. {
  508. type = 5,
  509. x0 = 3200, y0 = 1312,
  510. x1 = 3294, y1 = 1312,
  511. period = 6,
  512. t = 0.0625,
  513. frame = 6,
  514. fps = 16,
  515. },
  516. {
  517. type = 5,
  518. x0 = 1984, y0 = 920,
  519. x1 = 2126, y1 = 920,
  520. period = 9,
  521. t = 1.875,
  522. frame = 1,
  523. fps = 16,
  524. },
  525. {
  526. type = 6,
  527. x0 = 1248, y0 = 642,
  528. x1 = 1310, y1 = 642,
  529. period = 4,
  530. t = 1.625,
  531. frame = 2,
  532. fps = 16,
  533. },
  534. {
  535. type = 6,
  536. x0 = 1152, y0 = 1184,
  537. x1 = 1246, y1 = 1184,
  538. period = 6,
  539. t = 2,
  540. frame = 0,
  541. fps = 16,
  542. },
  543. {
  544. type = 6,
  545. x0 = 176, y0 = 1358,
  546. x1 = 270, y1 = 1358,
  547. period = 6,
  548. t = 2.8125,
  549. frame = 2,
  550. fps = 16,
  551. },
  552. {
  553. type = 6,
  554. x0 = 2560, y0 = 1210,
  555. x1 = 2718, y1 = 1210,
  556. period = 10,
  557. t = 0.5625,
  558. frame = 6,
  559. fps = 16,
  560. },
  561. {
  562. type = 6,
  563. x0 = 1808, y0 = 974,
  564. x1 = 1886, y1 = 974,
  565. period = 5,
  566. t = 0.125,
  567. frame = 5,
  568. fps = 16,
  569. },
  570. {
  571. type = 6,
  572. x0 = 3232, y0 = 1056,
  573. x1 = 3342, y1 = 1056,
  574. period = 7,
  575. t = 0.1875,
  576. frame = 3,
  577. fps = 16,
  578. },
  579. {
  580. type = 6,
  581. x0 = 3840, y0 = 970,
  582. x1 = 3934, y1 = 970,
  583. period = 6,
  584. t = 2.125,
  585. frame = 2,
  586. fps = 16,
  587. },
  588. {
  589. type = 6,
  590. x0 = 2512, y0 = 1800,
  591. x1 = 2574, y1 = 1800,
  592. period = 4,
  593. t = 1.5625,
  594. frame = 1,
  595. fps = 16,
  596. },
  597. {
  598. type = 7,
  599. x0 = 1622, y0 = 974,
  600. x1 = 1684, y1 = 974,
  601. period = 4,
  602. t = 1.125,
  603. frame = 5,
  604. fps = 16,
  605. },
  606. {
  607. type = 7,
  608. x0 = 1638, y0 = 1310,
  609. x1 = 1796, y1 = 1310,
  610. period = 10,
  611. t = 4.5625,
  612. frame = 1,
  613. fps = 16,
  614. },
  615. {
  616. type = 7,
  617. x0 = 3654, y0 = 1096,
  618. x1 = 3716, y1 = 1096,
  619. period = 4,
  620. t = 1,
  621. frame = 0,
  622. fps = 16,
  623. },
  624. {
  625. type = 7,
  626. x0 = 2438, y0 = 824,
  627. x1 = 2500, y1 = 824,
  628. period = 4,
  629. t = 1.125,
  630. frame = 2,
  631. fps = 16,
  632. },
  633. {
  634. type = 7,
  635. x0 = 1414, y0 = 1706,
  636. x1 = 1476, y1 = 1706,
  637. period = 4,
  638. t = 0.375,
  639. frame = 1,
  640. fps = 16,
  641. },
  642. {
  643. type = 7,
  644. x0 = 278, y0 = 1722,
  645. x1 = 436, y1 = 1722,
  646. period = 10,
  647. t = 0.3125,
  648. frame = 5,
  649. fps = 16,
  650. },
  651. {
  652. type = 7,
  653. x0 = 3062, y0 = 704,
  654. x1 = 3140, y1 = 704,
  655. period = 5,
  656. t = 1,
  657. frame = 0,
  658. fps = 16,
  659. },
  660. {
  661. type = 7,
  662. x0 = 2934, y0 = 476,
  663. x1 = 3028, y1 = 476,
  664. period = 6,
  665. t = 2.125,
  666. frame = 5,
  667. fps = 16,
  668. },
  669. }
  670. local orbs = {
  671. -- Mass from CoM calculation: m2 = m1 * (c / (L - c))
  672. -- m2 = mass of orb, m1 = mass of ship, L = length of tractor = 40
  673. -- c = CoM displacement (away from ship), which is the value in the table.
  674. { x = 777, y = 328, m = 4 }, -- orb 01 CoM=32
  675. { x = 393, y = 1048, m = 4 }, -- orb 02 CoM=32
  676. { x = 2825, y = 328, m = 3.4444444444444446 }, -- orb 03 CoM=31
  677. { x = 3465, y = 1048, m = 3.4444444444444446 }, -- orb 04 CoM=31
  678. { x = 2377, y = 984, m = 3 }, -- orb 05 CoM=30
  679. { x = 1433, y = 1192, m = 2.6363636363636362 }, -- orb 06 CoM=29
  680. { x = 3465, y = 1848, m = 2.3333333333333335 }, -- orb 07 CoM=28
  681. { x = 3465, y = 728, m = 2.0769230769230770 }, -- orb 08 CoM=27
  682. { x = 1305, y = 616, m = 1.8571428571428572 }, -- orb 09 CoM=26
  683. { x = 2009, y = 1512, m = 1.6666666666666667 }, -- orb 10 CoM=25
  684. { x = 969, y = 1368, m = 1.3529411764705883 }, -- orb 11 CoM=23
  685. { x = 649, y = 1496, m = 1.1052631578947370 }, -- orb 12 CoM=21
  686. { x = 2905, y = 680, m = 0.8181818181818182 }, -- orb 13 CoM=18
  687. { x = 153, y = 1192, m = 0.5384615384615384 }, -- orb 14 CoM=14
  688. { x = 3913, y = 1496, m = 0.2903225806451613 }, -- orb 15 CoM=9
  689. { x = 329, y = 1880, m = 0.2903225806451613 }, -- orb 16 CoM=9
  690. }
  691. local decoys = {
  692. { x = 3273, y = 1880 }, -- decoy 01
  693. { x = 3305, y = 1880 }, -- decoy 02
  694. { x = 3337, y = 1848 }, -- decoy 03
  695. { x = 3369, y = 1848 }, -- decoy 04
  696. { x = 3401, y = 1784 }, -- decoy 05
  697. { x = 3433, y = 1784 }, -- decoy 06
  698. { x = 3497, y = 1848 }, -- decoy 07
  699. { x = 3529, y = 1752 }, -- decoy 08
  700. { x = 3561, y = 1752 }, -- decoy 09
  701. { x = 3593, y = 1880 }, -- decoy 10
  702. { x = 3625, y = 1880 }, -- decoy 11
  703. }
  704. local targets = {
  705. { x = 58, y = 8, tile = 68, empty = 1 },
  706. { x = 57, y = 8, tile = 67, empty = 1 },
  707. { x = 58, y = 9, tile = 66, empty = 1 },
  708. { x = 57, y = 9, tile = 65, empty = 1 },
  709. { x = 58, y = 10, tile = 64, empty = 1 },
  710. { x = 57, y = 10, tile = 63, empty = 1 },
  711. { x = 58, y = 11, tile = 62, empty = 1 },
  712. { x = 57, y = 11, tile = 61, empty = 1 },
  713. { x = 59, y = 12, tile = 60, empty = 1 },
  714. { x = 58, y = 12, tile = 59, empty = 1 },
  715. { x = 57, y = 12, tile = 59, empty = 1 },
  716. { x = 56, y = 12, tile = 58, empty = 1 },
  717. { x = 59, y = 13, tile = 57, empty = 1 },
  718. { x = 58, y = 13, tile = 57, empty = 1 },
  719. { x = 57, y = 13, tile = 57, empty = 1 },
  720. { x = 56, y = 13, tile = 57, empty = 1 },
  721. }
  722. -- Where to revive in case of crash (assumed wxh from topleftx/toplefty)
  723. -- When the ship enters one of these squares, it's registered, and the next
  724. -- time it's respawned at the given x,y
  725. local respawn = {
  726. {
  727. topleftx = 0,
  728. toplefty = 0,
  729. w = 384,
  730. h = 384,
  731. x = 256,
  732. y = 158,
  733. },
  734. {
  735. topleftx = 512,
  736. toplefty = 0,
  737. w = 384,
  738. h = 384,
  739. x = 768,
  740. y = 170,
  741. },
  742. {
  743. topleftx = 1024,
  744. toplefty = 0,
  745. w = 384,
  746. h = 384,
  747. x = 1374,
  748. y = 146,
  749. },
  750. {
  751. topleftx = 1536,
  752. toplefty = 0,
  753. w = 384,
  754. h = 384,
  755. x = 1790,
  756. y = 146,
  757. },
  758. {
  759. topleftx = 2048,
  760. toplefty = 0,
  761. w = 384,
  762. h = 384,
  763. x = 2302,
  764. y = 146,
  765. },
  766. {
  767. topleftx = 2560,
  768. toplefty = 0,
  769. w = 384,
  770. h = 384,
  771. x = 2814,
  772. y = 146,
  773. },
  774. {
  775. topleftx = 3072,
  776. toplefty = 0,
  777. w = 384,
  778. h = 384,
  779. x = 3286,
  780. y = 146,
  781. },
  782. {
  783. topleftx = 3584,
  784. toplefty = 0,
  785. w = 384,
  786. h = 384,
  787. x = 3838,
  788. y = 146,
  789. },
  790. {
  791. topleftx = 320,
  792. toplefty = 768,
  793. w = 384,
  794. h = 384,
  795. x = 544,
  796. y = 898,
  797. },
  798. {
  799. topleftx = 576,
  800. toplefty = 1152,
  801. w = 384,
  802. h = 384,
  803. x = 822,
  804. y = 1266,
  805. },
  806. {
  807. topleftx = 1152,
  808. toplefty = 640,
  809. w = 384,
  810. h = 384,
  811. x = 1310,
  812. y = 770,
  813. },
  814. {
  815. topleftx = 128,
  816. toplefty = 1408,
  817. w = 384,
  818. h = 384,
  819. x = 358,
  820. y = 1522,
  821. },
  822. {
  823. topleftx = 512,
  824. toplefty = 1536,
  825. w = 384,
  826. h = 384,
  827. x = 894,
  828. y = 1690,
  829. },
  830. {
  831. topleftx = 896,
  832. toplefty = 1536,
  833. w = 384,
  834. h = 384,
  835. x = 1134,
  836. y = 1658,
  837. },
  838. {
  839. topleftx = 1472,
  840. toplefty = 1152,
  841. w = 384,
  842. h = 384,
  843. x = 1598,
  844. y = 1274,
  845. },
  846. {
  847. topleftx = 1920,
  848. toplefty = 896,
  849. w = 384,
  850. h = 384,
  851. x = 2086,
  852. y = 1034,
  853. },
  854. {
  855. topleftx = 1856,
  856. toplefty = 1472,
  857. w = 384,
  858. h = 384,
  859. x = 2070,
  860. y = 1586,
  861. },
  862. {
  863. topleftx = 2304,
  864. toplefty = 1408,
  865. w = 384,
  866. h = 384,
  867. x = 2542,
  868. y = 1562,
  869. },
  870. {
  871. topleftx = 2752,
  872. toplefty = 1600,
  873. w = 384,
  874. h = 384,
  875. x = 3006,
  876. y = 1722,
  877. },
  878. {
  879. topleftx = 3200,
  880. toplefty = 1600,
  881. w = 384,
  882. h = 384,
  883. x = 3478,
  884. y = 1722,
  885. },
  886. {
  887. topleftx = 2048,
  888. toplefty = 512,
  889. w = 384,
  890. h = 384,
  891. x = 2366,
  892. y = 650,
  893. },
  894. {
  895. topleftx = 2560,
  896. toplefty = 768,
  897. w = 384,
  898. h = 384,
  899. x = 2758,
  900. y = 906,
  901. },
  902. {
  903. topleftx = 2816,
  904. toplefty = 1152,
  905. w = 384,
  906. h = 384,
  907. x = 3014,
  908. y = 1290,
  909. },
  910. {
  911. topleftx = 3200,
  912. toplefty = 1152,
  913. w = 384,
  914. h = 384,
  915. x = 3358,
  916. y = 1290,
  917. },
  918. {
  919. topleftx = 3776,
  920. toplefty = 704,
  921. w = 384,
  922. h = 384,
  923. x = 3918,
  924. y = 850,
  925. },
  926. }
  927. -- tile -> enemy type (for agents)
  928. local agents = {
  929. [111] = 1, [117] = 2, [116] = 3, [118] = 4,
  930. [119] = 5, [120] = 6, [121] = 7, [115] = 8,
  931. }
  932. -- require() can't return multiple values, so we wrap them in a function
  933. return function()
  934. return map, enemytypes, enemies, orbs, decoys, targets, respawn, agents
  935. end