From 3a86c4674d859acf66d2b3be53c415d9b47a264b Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Sat, 2 Jul 2022 13:04:58 -0400 Subject: [PATCH] scrolling kinda works if you squint! Signed-off-by: Christine Dodrill --- maps/RPGmap.json | 771 ++++++++++++++++++++--------------------- maps/RPGmap.tmx | 208 +++++------ sprites/Mara Icon.png | Bin 326 -> 356 bytes src/main.zig | 81 ++--- src/maps/dungeon.zig | 10 +- src/maps/overworld.zig | 10 +- src/tools/genmap.js | 10 +- src/wasm4.zig | 18 +- 8 files changed, 540 insertions(+), 568 deletions(-) diff --git a/maps/RPGmap.json b/maps/RPGmap.json index 8296e27..7fbaf27 100644 --- a/maps/RPGmap.json +++ b/maps/RPGmap.json @@ -1,402 +1,371 @@ -{ "compressionlevel":-1, - "height":40, - "infinite":false, - "layers":[ - { - "data":[1, 2, 39, 40, 1, 2, 137, 138, 1, 2, 71, 72, 73, 74, 75, 76, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, - 35, 36, 73, 74, 35, 36, 171, 172, 35, 36, 105, 106, 107, 108, 109, 110, 35, 39, 40, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, - 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 139, 140, 207, 208, 143, 144, 69, 73, 74, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, - 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 173, 174, 241, 242, 177, 178, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, - 137, 138, 137, 138, 307, 274, 137, 138, 341, 342, 345, 346, 411, 412, 137, 138, 1, 2, 33, 34, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, - 171, 172, 171, 172, 307, 307, 171, 172, 375, 376, 379, 380, 445, 446, 171, 172, 35, 36, 67, 68, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, - 205, 206, 205, 206, 69, 70, 205, 206, 413, 414, 39, 40, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, - 239, 240, 239, 240, 103, 104, 39, 40, 447, 448, 73, 74, 307, 104, 239, 274, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, - 1, 2, 137, 307, 1, 2, 73, 74, 413, 414, 137, 39, 40, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, - 35, 36, 171, 172, 35, 36, 171, 172, 447, 448, 171, 73, 74, 36, 171, 172, 331, 332, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, - 69, 70, 205, 206, 69, 70, 274, 206, 413, 414, 235, 236, 233, 234, 205, 364, 365, 366, 367, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, - 103, 104, 239, 240, 39, 40, 239, 240, 447, 448, 269, 270, 267, 268, 397, 398, 399, 400, 401, 402, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, - 1, 2, 237, 238, 73, 74, 137, 138, 413, 414, 233, 234, 235, 236, 431, 432, 433, 434, 435, 436, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, - 35, 36, 271, 272, 35, 353, 354, 172, 447, 448, 267, 268, 269, 270, 465, 466, 467, 468, 469, 470, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, - 69, 70, 351, 352, 69, 387, 388, 206, 347, 348, 349, 350, 343, 344, 499, 500, 439, 440, 503, 504, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, - 103, 104, 385, 386, 103, 104, 239, 240, 381, 121, 121, 121, 121, 378, 403, 404, 473, 474, 405, 406, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, - 1, 2, 409, 410, 345, 346, 345, 346, 417, 121, 121, 121, 121, 418, 345, 346, 417, 418, 345, 346, 345, 346, 345, 346, 345, 346, 345, 346, 345, 346, 345, 346, 345, 346, 345, 346, 345, 346, 345, 346, - 35, 36, 443, 444, 379, 380, 379, 380, 451, 452, 451, 452, 451, 452, 379, 380, 451, 452, 379, 380, 379, 380, 379, 380, 379, 380, 379, 380, 379, 380, 379, 380, 379, 380, 379, 380, 379, 380, 379, 380, - 69, 57, 58, 206, 69, 70, 205, 206, 69, 307, 205, 206, 69, 70, 205, 206, 39, 40, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, - 90, 91, 92, 93, 57, 58, 57, 58, 103, 104, 239, 240, 103, 104, 239, 240, 73, 74, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, - 91, 92, 91, 92, 91, 92, 91, 92, 93, 21, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, - 125, 126, 125, 126, 125, 126, 125, 126, 127, 94, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, - 159, 160, 159, 160, 159, 160, 159, 160, 70, 26, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, - 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, - 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, - 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, - 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, - 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, - 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, - 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, - 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, - 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, - 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, - 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, - 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, - 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, - 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, - 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, - 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, - 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240], - "height":40, - "id":1, - "name":"map", - "opacity":1, - "type":"tilelayer", - "visible":true, - "width":40, - "x":0, - "y":0 - }, - { - "draworder":"topdown", - "id":2, - "name":"coll", - "objects":[ - { - "class":"", - "height":16.4512, - "id":1, - "name":"", - "rotation":0, - "visible":true, - "width":47.399, - "x":80.3013, - "y":-0.325766 - }, - { - "class":"", - "height":9.44722, - "id":6, - "name":"", - "rotation":0, - "visible":true, - "width":16.2883, - "x":127.863, - "y":70.3655 - }, - { - "class":"", - "height":15.8182, - "id":16, - "name":"", - "rotation":0, - "visible":true, - "width":11.4545, - "x":146.182, - "y":32 - }, - { - "class":"", - "height":12.7273, - "id":17, - "name":"", - "rotation":0, - "visible":true, - "width":11.8182, - "x":18, - "y":97.8182 - }, - { - "class":"", - "height":13.4545, - "id":18, - "name":"", - "rotation":0, - "visible":true, - "width":12, - "x":113.818, - "y":16.3636 - }, - { - "class":"", - "height":14.5455, - "id":19, - "name":"", - "rotation":0, - "visible":true, - "width":13.0909, - "x":81.2727, - "y":16.3636 - }, - { - "class":"", - "height":26.7273, - "id":20, - "name":"", - "rotation":0, - "visible":true, - "width":26, - "x":82.9091, - "y":85.2727 - }, - { - "class":"", - "height":4.54545, - "id":21, - "name":"", - "rotation":0, - "visible":true, - "width":8.18182, - "x":99.6364, - "y":80.9091 - }, - { - "class":"", - "height":17.2727, - "id":22, - "name":"", - "rotation":0, - "visible":true, - "width":47.6364, - "x":112, - "y":94.1818 - }, - { - "class":"", - "height":7.27273, - "id":23, - "name":"", - "rotation":0, - "visible":true, - "width":30.3636, - "x":120.727, - "y":86.9091 - }, - { - "class":"", - "height":7.09091, - "id":24, - "name":"", - "rotation":0, - "visible":true, - "width":16.3636, - "x":127.636, - "y":80 - }, - { - "class":"", - "height":12.5455, - "id":25, - "name":"", - "rotation":0, - "visible":true, - "width":11.4545, - "x":114.364, - "y":111.818 - }, - { - "class":"", - "height":12.5455, - "id":26, - "name":"", - "rotation":0, - "visible":true, - "width":12.1818, - "x":145.091, - "y":111.273 - }, - { - "class":"", - "height":7.09091, - "id":28, - "name":"", - "rotation":0, - "visible":true, - "width":8.90909, - "x":11.2727, - "y":146.182 - }, - { - "class":"", - "height":27.4299344066786, - "id":36, - "name":"", - "rotation":0, - "visible":true, - "width":61.2204333134566, - "x":0.397535281256212, - "y":153.846153846154 - }, - { - "class":"", - "height":11.1309878751739, - "id":37, - "name":"", - "rotation":0, - "visible":true, - "width":8.34824090638045, - "x":62.015503875969, - "y":162.194394752534 - }], - "opacity":1, - "type":"objectgroup", - "visible":true, - "x":0, - "y":0 - }, - { - "draworder":"topdown", - "id":3, - "name":"act", - "objects":[ - { - "class":"", - "height":20, - "id":30, - "name":"sign", - "properties":[ - { - "name":"dialogue", - "type":"string", - "value":"18 chars per line\\nallowed. Or else!" - }, - { - "name":"direction", - "type":"string", - "value":"Up" - }], - "rotation":0, - "visible":true, - "width":16, - "x":16, - "y":96 - }, - { - "class":"", - "height":16, - "id":31, - "name":"gravestone 1", - "properties":[ - { - "name":"dialogue", - "type":"string", - "value":"Ded." - }, - { - "name":"direction", - "type":"string", - "value":"Up" - }], - "rotation":0, - "visible":true, - "width":7, - "x":82.64, - "y":103 - }, - { - "class":"", - "height":16, - "id":32, - "name":"gravestone 2", - "properties":[ - { - "name":"dialogue", - "type":"string", - "value":"Moar ded." - }, - { - "name":"direction", - "type":"string", - "value":"Up" - }], - "rotation":0, - "visible":true, - "width":7, - "x":96.18, - "y":103.36 - }], - "opacity":1, - "type":"objectgroup", - "visible":true, - "x":0, - "y":0 - }, - { - "draworder":"topdown", - "id":5, - "name":"warps", - "objects":[ - { - "class":"", - "height":10, - "id":35, - "name":"dungeon 1", - "properties":[ - { - "name":"warpTarget", - "type":"int", - "value":1 - }], - "rotation":0, - "visible":true, - "width":14.978, - "x":96.4758, - "y":17.0705 - }, - { - "class":"", - "height":7.95070562512423, - "id":38, - "name":"house 1", - "properties":[ - { - "name":"warpTarget", - "type":"int", - "value":2 - }], - "rotation":0, - "visible":true, - "width":14.7088054064798, - "x":128.801431127013, - "y":112.900019876764 - }], - "opacity":1, - "type":"objectgroup", - "visible":true, - "x":0, - "y":0 - }, - { - "draworder":"topdown", - "id":4, - "name":"spc", - "objects":[ - { - "class":"", - "height":16, - "id":33, - "name":"mara_start", - "rotation":0, - "visible":true, - "width":16, - "x":32, - "y":31 - }], - "opacity":1, - "type":"objectgroup", - "visible":true, - "x":0, - "y":0 - }], - "nextlayerid":6, - "nextobjectid":39, - "orientation":"orthogonal", - "renderorder":"right-down", - "tiledversion":"1.9.0", - "tileheight":8, - "tilesets":[ - { - "firstgid":1, - "source":"..\/sprites\/kenney_rpg.tsx" - }], - "tilewidth":8, - "type":"map", - "version":"1.9", - "width":40 +{ "compressionlevel":-1, + "editorsettings": + { + "export": + { + "format":"json", + "target":"RPGmap.json" + } + }, + "height":40, + "infinite":false, + "layers":[ + { + "data":[1, 2, 39, 40, 1, 2, 137, 138, 1, 2, 71, 72, 73, 74, 75, 76, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 35, 36, 73, 74, 35, 36, 171, 172, 35, 36, 105, 106, 107, 108, 109, 110, 35, 39, 40, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 139, 140, 207, 208, 143, 144, 69, 73, 74, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 173, 174, 241, 242, 177, 178, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 137, 138, 137, 138, 307, 274, 137, 138, 341, 342, 345, 346, 411, 412, 137, 138, 1, 2, 33, 34, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 171, 172, 171, 172, 307, 307, 171, 172, 375, 376, 379, 380, 445, 446, 171, 172, 35, 36, 67, 68, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 205, 206, 205, 206, 69, 70, 205, 206, 413, 414, 39, 40, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 239, 240, 239, 240, 103, 104, 39, 40, 447, 448, 73, 74, 307, 104, 239, 274, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 1, 2, 137, 307, 1, 2, 73, 74, 413, 414, 137, 39, 40, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 35, 36, 171, 172, 35, 36, 171, 172, 447, 448, 171, 73, 74, 36, 171, 172, 331, 332, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 69, 70, 205, 206, 69, 70, 274, 206, 413, 414, 235, 236, 233, 234, 205, 364, 365, 366, 367, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 103, 104, 239, 240, 39, 40, 239, 240, 447, 448, 269, 270, 267, 268, 397, 398, 399, 400, 401, 402, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 1, 2, 237, 238, 73, 74, 137, 138, 413, 414, 233, 234, 235, 236, 431, 432, 433, 434, 435, 436, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 35, 36, 271, 272, 35, 353, 354, 172, 447, 448, 267, 268, 269, 270, 465, 466, 467, 468, 469, 470, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 69, 70, 351, 352, 69, 387, 388, 206, 347, 348, 349, 350, 343, 344, 499, 500, 439, 440, 503, 504, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 103, 104, 385, 386, 103, 104, 239, 240, 381, 121, 121, 121, 121, 378, 403, 404, 473, 474, 405, 406, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 1, 2, 409, 410, 345, 346, 345, 346, 417, 121, 121, 121, 121, 418, 345, 346, 417, 418, 345, 346, 345, 346, 345, 346, 345, 346, 345, 346, 345, 346, 345, 346, 345, 346, 345, 346, 345, 346, 345, 346, 35, 36, 443, 444, 379, 380, 379, 380, 451, 452, 451, 452, 451, 452, 379, 380, 451, 452, 379, 380, 379, 380, 379, 380, 379, 380, 379, 380, 379, 380, 379, 380, 379, 380, 379, 380, 379, 380, 379, 380, 69, 57, 58, 206, 69, 70, 205, 206, 69, 307, 205, 206, 69, 70, 205, 206, 39, 40, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 90, 91, 92, 93, 57, 58, 57, 58, 103, 104, 239, 240, 103, 104, 239, 240, 73, 74, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 91, 92, 91, 92, 91, 92, 91, 92, 93, 21, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 125, 126, 125, 126, 125, 126, 125, 126, 127, 94, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 159, 160, 159, 160, 159, 160, 159, 160, 70, 26, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 1, 2, 137, 138, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 35, 36, 171, 172, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 205, 206, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 239, 240], + "height":40, + "id":1, + "name":"map", + "opacity":1, + "type":"tilelayer", + "visible":true, + "width":40, + "x":0, + "y":0 + }, + { + "draworder":"topdown", + "id":2, + "name":"coll", + "objects":[ + { + "height":16.4512, + "id":1, + "name":"", + "rotation":0, + "type":"", + "visible":true, + "width":47.399, + "x":80.3013, + "y":-0.325766 + }, + { + "height":9.44722, + "id":6, + "name":"", + "rotation":0, + "type":"", + "visible":true, + "width":16.2883, + "x":127.863, + "y":70.3655 + }, + { + "height":15.8182, + "id":16, + "name":"", + "rotation":0, + "type":"", + "visible":true, + "width":11.4545, + "x":146.182, + "y":32 + }, + { + "height":12.7273, + "id":17, + "name":"", + "rotation":0, + "type":"", + "visible":true, + "width":11.8182, + "x":18, + "y":97.8182 + }, + { + "height":13.4545, + "id":18, + "name":"", + "rotation":0, + "type":"", + "visible":true, + "width":12, + "x":113.818, + "y":16.3636 + }, + { + "height":14.5455, + "id":19, + "name":"", + "rotation":0, + "type":"", + "visible":true, + "width":13.0909, + "x":81.2727, + "y":16.3636 + }, + { + "height":26.7273, + "id":20, + "name":"", + "rotation":0, + "type":"", + "visible":true, + "width":26, + "x":82.9091, + "y":85.2727 + }, + { + "height":4.54545, + "id":21, + "name":"", + "rotation":0, + "type":"", + "visible":true, + "width":8.18182, + "x":99.6364, + "y":80.9091 + }, + { + "height":17.2727, + "id":22, + "name":"", + "rotation":0, + "type":"", + "visible":true, + "width":47.6364, + "x":112, + "y":94.1818 + }, + { + "height":7.27273, + "id":23, + "name":"", + "rotation":0, + "type":"", + "visible":true, + "width":30.3636, + "x":120.727, + "y":86.9091 + }, + { + "height":7.09091, + "id":24, + "name":"", + "rotation":0, + "type":"", + "visible":true, + "width":16.3636, + "x":127.636, + "y":80 + }, + { + "height":12.5455, + "id":25, + "name":"", + "rotation":0, + "type":"", + "visible":true, + "width":11.4545, + "x":114.364, + "y":111.818 + }, + { + "height":12.5455, + "id":26, + "name":"", + "rotation":0, + "type":"", + "visible":true, + "width":12.1818, + "x":145.091, + "y":111.273 + }, + { + "height":7.09091, + "id":28, + "name":"", + "rotation":0, + "type":"", + "visible":true, + "width":8.90909, + "x":11.2727, + "y":146.182 + }, + { + "height":27.4299, + "id":36, + "name":"", + "rotation":0, + "type":"", + "visible":true, + "width":61.2204, + "x":0.397535, + "y":153.846 + }, + { + "height":11.131, + "id":37, + "name":"", + "rotation":0, + "type":"", + "visible":true, + "width":8.34824, + "x":62.0155, + "y":162.194 + }], + "opacity":1, + "type":"objectgroup", + "visible":true, + "x":0, + "y":0 + }, + { + "draworder":"topdown", + "id":3, + "name":"act", + "objects":[ + { + "height":20, + "id":30, + "name":"sign", + "properties":[ + { + "name":"dialogue", + "type":"string", + "value":"18 chars per line\\nallowed. Or else!" + }, + { + "name":"direction", + "type":"string", + "value":"Up" + }], + "rotation":0, + "type":"", + "visible":true, + "width":16, + "x":16, + "y":96 + }, + { + "height":16, + "id":31, + "name":"gravestone 1", + "properties":[ + { + "name":"dialogue", + "type":"string", + "value":"Ded." + }, + { + "name":"direction", + "type":"string", + "value":"Up" + }], + "rotation":0, + "type":"", + "visible":true, + "width":7, + "x":82.64, + "y":103 + }, + { + "height":16, + "id":32, + "name":"gravestone 2", + "properties":[ + { + "name":"dialogue", + "type":"string", + "value":"Moar ded." + }, + { + "name":"direction", + "type":"string", + "value":"Up" + }], + "rotation":0, + "type":"", + "visible":true, + "width":7, + "x":96.18, + "y":103.36 + }], + "opacity":1, + "type":"objectgroup", + "visible":true, + "x":0, + "y":0 + }, + { + "draworder":"topdown", + "id":5, + "name":"warps", + "objects":[ + { + "height":10, + "id":35, + "name":"dungeon 1", + "properties":[ + { + "name":"warpTarget", + "type":"int", + "value":1 + }], + "rotation":0, + "type":"", + "visible":true, + "width":14.978, + "x":96.4758, + "y":17.0705 + }, + { + "height":7.95071, + "id":38, + "name":"house 1", + "properties":[ + { + "name":"warpTarget", + "type":"int", + "value":2 + }], + "rotation":0, + "type":"", + "visible":true, + "width":14.7088, + "x":128.801, + "y":112.9 + }], + "opacity":1, + "type":"objectgroup", + "visible":true, + "x":0, + "y":0 + }, + { + "draworder":"topdown", + "id":4, + "name":"spc", + "objects":[ + { + "height":16, + "id":33, + "name":"mara_start", + "rotation":0, + "type":"", + "visible":true, + "width":16, + "x":32, + "y":31 + }], + "opacity":1, + "type":"objectgroup", + "visible":true, + "x":0, + "y":0 + }], + "nextlayerid":6, + "nextobjectid":39, + "orientation":"orthogonal", + "renderorder":"right-down", + "tiledversion":"1.4.3", + "tileheight":8, + "tilesets":[ + { + "firstgid":1, + "source":"..\/sprites\/kenney_rpg.tsx" + }], + "tilewidth":8, + "type":"map", + "version":1.4, + "width":40 } \ No newline at end of file diff --git a/maps/RPGmap.tmx b/maps/RPGmap.tmx index 22ae036..cb72c01 100644 --- a/maps/RPGmap.tmx +++ b/maps/RPGmap.tmx @@ -1,104 +1,104 @@ - - - - - - - - -1,2,39,40,1,2,137,138,1,2,71,72,73,74,75,76,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138, -35,36,73,74,35,36,171,172,35,36,105,106,107,108,109,110,35,39,40,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172, -69,70,205,206,69,70,205,206,69,70,139,140,207,208,143,144,69,73,74,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206, -103,104,239,240,103,104,239,240,103,104,173,174,241,242,177,178,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240, -137,138,137,138,307,274,137,138,341,342,345,346,411,412,137,138,1,2,33,34,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138, -171,172,171,172,307,307,171,172,375,376,379,380,445,446,171,172,35,36,67,68,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172, -205,206,205,206,69,70,205,206,413,414,39,40,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206, -239,240,239,240,103,104,39,40,447,448,73,74,307,104,239,274,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240, -1,2,137,307,1,2,73,74,413,414,137,39,40,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138, -35,36,171,172,35,36,171,172,447,448,171,73,74,36,171,172,331,332,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172, -69,70,205,206,69,70,274,206,413,414,235,236,233,234,205,364,365,366,367,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206, -103,104,239,240,39,40,239,240,447,448,269,270,267,268,397,398,399,400,401,402,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240, -1,2,237,238,73,74,137,138,413,414,233,234,235,236,431,432,433,434,435,436,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138, -35,36,271,272,35,353,354,172,447,448,267,268,269,270,465,466,467,468,469,470,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172, -69,70,351,352,69,387,388,206,347,348,349,350,343,344,499,500,439,440,503,504,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206, -103,104,385,386,103,104,239,240,381,121,121,121,121,378,403,404,473,474,405,406,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240, -1,2,409,410,345,346,345,346,417,121,121,121,121,418,345,346,417,418,345,346,345,346,345,346,345,346,345,346,345,346,345,346,345,346,345,346,345,346,345,346, -35,36,443,444,379,380,379,380,451,452,451,452,451,452,379,380,451,452,379,380,379,380,379,380,379,380,379,380,379,380,379,380,379,380,379,380,379,380,379,380, -69,57,58,206,69,70,205,206,69,307,205,206,69,70,205,206,39,40,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206, -90,91,92,93,57,58,57,58,103,104,239,240,103,104,239,240,73,74,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240, -91,92,91,92,91,92,91,92,93,21,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138, -125,126,125,126,125,126,125,126,127,94,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172, -159,160,159,160,159,160,159,160,70,26,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206, -103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240, -1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138, -35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172, -69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206, -103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240, -1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138, -35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172, -69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206, -103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240, -1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138, -35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172, -69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206, -103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240, -1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138, -35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172, -69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206, -103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + +1,2,39,40,1,2,137,138,1,2,71,72,73,74,75,76,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138, +35,36,73,74,35,36,171,172,35,36,105,106,107,108,109,110,35,39,40,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172, +69,70,205,206,69,70,205,206,69,70,139,140,207,208,143,144,69,73,74,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206, +103,104,239,240,103,104,239,240,103,104,173,174,241,242,177,178,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240, +137,138,137,138,307,274,137,138,341,342,345,346,411,412,137,138,1,2,33,34,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138, +171,172,171,172,307,307,171,172,375,376,379,380,445,446,171,172,35,36,67,68,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172, +205,206,205,206,69,70,205,206,413,414,39,40,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206, +239,240,239,240,103,104,39,40,447,448,73,74,307,104,239,274,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240, +1,2,137,307,1,2,73,74,413,414,137,39,40,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138, +35,36,171,172,35,36,171,172,447,448,171,73,74,36,171,172,331,332,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172, +69,70,205,206,69,70,274,206,413,414,235,236,233,234,205,364,365,366,367,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206, +103,104,239,240,39,40,239,240,447,448,269,270,267,268,397,398,399,400,401,402,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240, +1,2,237,238,73,74,137,138,413,414,233,234,235,236,431,432,433,434,435,436,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138, +35,36,271,272,35,353,354,172,447,448,267,268,269,270,465,466,467,468,469,470,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172, +69,70,351,352,69,387,388,206,347,348,349,350,343,344,499,500,439,440,503,504,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206, +103,104,385,386,103,104,239,240,381,121,121,121,121,378,403,404,473,474,405,406,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240, +1,2,409,410,345,346,345,346,417,121,121,121,121,418,345,346,417,418,345,346,345,346,345,346,345,346,345,346,345,346,345,346,345,346,345,346,345,346,345,346, +35,36,443,444,379,380,379,380,451,452,451,452,451,452,379,380,451,452,379,380,379,380,379,380,379,380,379,380,379,380,379,380,379,380,379,380,379,380,379,380, +69,57,58,206,69,70,205,206,69,307,205,206,69,70,205,206,39,40,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206, +90,91,92,93,57,58,57,58,103,104,239,240,103,104,239,240,73,74,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240, +91,92,91,92,91,92,91,92,93,21,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138, +125,126,125,126,125,126,125,126,127,94,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172, +159,160,159,160,159,160,159,160,70,26,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206, +103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240, +1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138, +35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172, +69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206, +103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240, +1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138, +35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172, +69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206, +103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240, +1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138, +35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172, +69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206, +103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240, +1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138,1,2,137,138, +35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172,35,36,171,172, +69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206,69,70,205,206, +103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240,103,104,239,240 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sprites/Mara Icon.png b/sprites/Mara Icon.png index 338784b73a30eabe1422c05d5f2e454c94994438..d5e3f1135178b1046c857d1ffc1237d23bb32927 100644 GIT binary patch delta 316 zcmX@c^n_`GVZC&KPl#*ke})G?&bJ-NF~|sDmr#89>B+j4QyCZ-{xdMRI=;6CvN%hE z{DK+&g8{?;C2DEQfP#-aT^vIy=DfXb$k%Kjz~a!=^5nn1-(gejxjc&=F1mS+?Y(d6 z!EctIvNqlIxgK3?&cM)cobjIfH|5xaTv5NT2JdBHsAni`dJg8};n z_g#mi<}eH0`pU?_V8egmuSbmRoadX?KLc85BR*lm=H~E*H$as$m_0oBUd>}>U^v6B zqGIo}YYiKS&G^I>WD(HVQU(2KUVj%nshj@FlY@cbfQ-Z1^-jCwfR6ajxJCh_gpo7S z^k7(X5iiKz3ytfTb^%2};0&|MlQ(uiJ&zgfpC12wFnx}PH%Q#m)z4*}Q$iB}^Q?Lf delta 286 zcmaFDbc|_&VLg9jG_9JEf#DW| zUG=`|RZWo(E9|S>^cffqR5Mg6BpPS@V`pIaAa}q#NHnaT`RCqO%nS@K*ga0%d}uSh z_Nf5_gM+k#Q&@X?!_!0thK90+mL~yUWf>SA{B3Ai6X&v>7pUBZ??m^rETEI_F-x$2 zO0t}NaWfCl#te3e^X~1d<$w}E(D1LJ { w4.m.colors.* = .{ @@ -91,58 +90,44 @@ fn drawMap() !void { }; }, } - if (!done) { - var buf = fmt.bufPrint(&textBuf, "camera: {},{}", .{ camera.x, camera.y }) catch unreachable; - w4.trace(buf); - } +} - var startCol: i32 = @divTrunc(camera.x, tile_size); +fn drawMap() !void { + map_colors(); + + var startCol = @divTrunc(camera.x, tile_size); var endCol = startCol + screen_width; - var startRow: i32 = @divTrunc(camera.y, tile_size); + var startRow = @divTrunc(camera.y, tile_size); var endRow = startRow + screen_height; - var offsetX = startCol * tile_size; - var offsetY = startRow * tile_size; - if (!done) { var buf = fmt.bufPrint(&textBuf, "{},{}: {},{}", .{ startCol, startRow, endCol, endRow }) catch unreachable; w4.trace(buf); } - if (!done) { - var buf = fmt.bufPrint(&textBuf, "offx: {}, offy: {}", .{ offsetX, offsetY }) catch unreachable; - w4.trace(buf); - } - var col: i32 = startCol; + var col: i16 = startCol; while (col < endCol) { - var row: i32 = startRow; + var row: i16 = startRow; defer col += 1; while (row < endRow) { defer row += 1; - var tile = map.get_tile(@intCast(u32, col), @intCast(u32, row)); + if (col < map.width and row < map.height) { + var tile = map.get_tile(col, row); + var world = Point{ .x = col * 8, .y = row * 8 }; + var scr = world_to_screen(world); + if(!done) { + var buf = fmt.bufPrint(&textBuf, "{},{}: {},{}", .{ row, col, scr.x, scr.y }) catch unreachable; + w4.trace(buf); + } - var x = (row - startCol) * tile_size - offsetX; - var y = (col - startRow) * tile_size - offsetY; - - if (x < 0) { - x = x * -1; + draw_tile(tile, scr.y, scr.x); } - if (y < 0) { - y = y * -1; - } - - if (!done) { - var buf = fmt.bufPrint(&textBuf, "{},{}: {}: {},{}", .{ col, row, tile, x, y }) catch unreachable; - w4.trace(buf); - } - - draw_tile(tile, @intCast(u32, x), @intCast(u32, y)); } } } -fn draw_tile(tile: u32, x: u32, y: u32) void { +fn draw_tile(tile: u32, x: i32, y: i32) void { if (tile == 0) { w4.rect(x, y, 8, 8); return; @@ -158,8 +143,8 @@ fn draw_tile(tile: u32, x: u32, y: u32) void { y, 8, 8, - @intCast(u32, tileX) * 8, - @intCast(u32, tileY) * 8, + tileX * 8, + tileY * 8, sprites.kenney_rpg_width, w4.BlitFlags{ .two_bits = true }, ), @@ -169,8 +154,8 @@ fn draw_tile(tile: u32, x: u32, y: u32) void { y, 8, 8, - @intCast(u32, tileX) * 8, - @intCast(u32, tileY) * 8, + tileX * 8, + tileY * 8, sprites.dungeon_width, w4.BlitFlags{ .two_bits = true }, ), @@ -197,16 +182,16 @@ fn move_mara(gamepad: w4.GamePad) void { switch (mara_direction) { .Up => { - mara_box.base.y -= mara_speed; + camera.x -= mara_speed; }, .Down => { - mara_box.base.y += mara_speed; + camera.x += mara_speed; }, .Left => { - mara_box.base.x -= mara_speed; + camera.y -= mara_speed; }, .Right => { - mara_box.base.x += mara_speed; + camera.y += mara_speed; }, } } @@ -232,7 +217,7 @@ fn title() !void { } const story = "After defeating\nthe evil mage,\nMalto was at\npeace.\n\nOne day Mara was\nwalking along the\nbeach when she saw\nthe killing stone\nwas split in two.\nTamamo-no-Mae was\nfree to wreak havoc\nacross the land.\n\nHelp us again Mara!\nSave Kanar from\nTamamo-no-Mae!\n\nPress x."; -var story_idx: usize = 0; +var story_idx: u16 = 0; var story_counter: u8 = 4; fn storydump() !void { @@ -378,7 +363,7 @@ fn draw_mara() void { flags.flip_x = true; } - if (frame_count % 32 == 0 and mara_speed > 0) { + if (frame_count % 16 == 0 and mara_speed > 0) { mara_frame = !mara_frame; } @@ -390,12 +375,12 @@ fn draw_mara() void { }; var step: u32 = if (mara_frame) 1 else 0; - w4.blitSub(&sprites.Mara, @intCast(u32, mara_box.base.x), @intCast(u32, mara_box.base.y), 16, 16, 16 * (frame + step), 0, 96, flags); + w4.blitSub(&sprites.Mara, mara_box.base.x, mara_box.base.y, 16, 16, 16 * (frame + step), 0, 96, flags); } pub fn panic(msg: []const u8, st: ?*std.builtin.StackTrace) noreturn { _ = st; w4.trace("!!! PANIC !!!"); w4.trace(msg); - while (true) {} + unreachable; } diff --git a/src/maps/dungeon.zig b/src/maps/dungeon.zig index 13c6d8b..2a7f280 100644 --- a/src/maps/dungeon.zig +++ b/src/maps/dungeon.zig @@ -10,8 +10,14 @@ const Rect = sh0rk.Rect; pub const width = 20; pub const height = 20; -pub fn get_tile(x: u32, y: u32) u9 { - return data[x * height + y]; +pub fn get_tile(x: i32, y: i32) u9 { + if (x < 0 or y < 0) { + return 0; + } + if (x >= width or y >= height) { + return 0; + } + return data[@intCast(u32, x) * height + @intCast(u32, y)]; } pub const tileset: Tileset = .Dungeon; pub const ts_width = 14; diff --git a/src/maps/overworld.zig b/src/maps/overworld.zig index d04bfcf..e7b1923 100644 --- a/src/maps/overworld.zig +++ b/src/maps/overworld.zig @@ -10,8 +10,14 @@ const Rect = sh0rk.Rect; pub const width = 40; pub const height = 40; -pub fn get_tile(x: u32, y: u32) u9 { - return data[x * height + y]; +pub fn get_tile(x: i32, y: i32) u9 { + if (x < 0 or y < 0) { + return 0; + } + if (x >= width or y >= height) { + return 0; + } + return data[@intCast(u32, x) * height + @intCast(u32, y)]; } pub const tileset: Tileset = .Rpg; pub const ts_width = 34; diff --git a/src/tools/genmap.js b/src/tools/genmap.js index bb1ce10..a8d5b57 100644 --- a/src/tools/genmap.js +++ b/src/tools/genmap.js @@ -24,8 +24,14 @@ out += `const Rect = sh0rk.Rect;\n\n`; out += `pub const width = ${map.width};\n`; out += `pub const height = ${map.height};\n\n`; -out += `pub fn get_tile(x: u32, y: u32) u9 { - return data[x * height + y]; +out += `pub fn get_tile(x: i32, y: i32) u9 { + if (x < 0 or y < 0) { + return 0; + } + if (x >= width or y >= height) { + return 0; + } + return data[@intCast(u32, x) * height + @intCast(u32, y)]; } `; diff --git a/src/wasm4.zig b/src/wasm4.zig index 09925c8..9594efb 100644 --- a/src/wasm4.zig +++ b/src/wasm4.zig @@ -116,8 +116,8 @@ pub const SystemFlags = packed struct { // └───────────────────────────────────────────────────────────────────────────┘ const raw_api = struct { - extern fn blit(sprite: [*]const u8, x: u32, y: u32, width: u32, height: u32, flags: u32) void; - extern fn blitSub(sprite: [*]const u8, x: u32, y: u32, width: u32, height: u32, src_x: u32, src_y: u32, stride: u32, flags: u32) void; + extern fn blit(sprite: [*]const u8, x: i32, y: i32, width: u32, height: u32, flags: u32) void; + extern fn blitSub(sprite: [*]const u8, x: i32, y: i32, width: u32, height: u32, src_x: u32, src_y: u32, stride: u32, flags: u32) void; extern fn tone(frequency: u32, duration: u32, volume: u32, flags: u32) void; }; @@ -137,7 +137,7 @@ pub const BlitFlags = packed struct { }; /// Copies pixels to the framebuffer. -pub fn blit(sprite: []const u8, x: u32, y: u32, width: u32, height: u32, flags: BlitFlags) void { +pub fn blit(sprite: []const u8, x: i32, y: i32, width: u32, height: u32, flags: BlitFlags) void { raw_api.blit(sprite.ptr, x, y, width, height, @bitCast(u32, flags)); } @@ -145,24 +145,24 @@ pub fn blit(sprite: []const u8, x: u32, y: u32, width: u32, height: u32, flags: /// srcX: Source X position of the sprite region. /// srcY: Source Y position of the sprite region. /// stride: Total width of the overall sprite atlas. This is typically larger than width. -pub fn blitSub(sprite: []const u8, x: u32, y: u32, width: u32, height: u32, src_x: u32, src_y: u32, stride: u32, flags: BlitFlags) void { +pub fn blitSub(sprite: []const u8, x: i32, y: i32, width: u32, height: u32, src_x: u32, src_y: u32, stride: u32, flags: BlitFlags) void { raw_api.blitSub(sprite.ptr, x, y, width, height, src_x, src_y, stride, @bitCast(u32, flags)); } /// Draws a line between two points. -pub extern fn line(x1: u32, y1: u32, x2: u32, y2: u32) void; +pub extern fn line(x1: i32, y1: i32, x2: i32, y2: i32) void; /// Draws an oval (or circle). -pub extern fn oval(x: u32, y: u32, width: u32, height: u32) void; +pub extern fn oval(x: i32, y: i32, width: u32, height: u32) void; /// Draws a rectangle. -pub extern fn rect(x: u32, y: u32, width: u32, height: u32) void; +pub extern fn rect(x: i32, y: i32, width: u32, height: u32) void; /// Draws text using the built-in system font. -pub fn text(str: []const u8, x: u32, y: u32) void { +pub fn text(str: []const u8, x: i32, y: i32) void { textUtf8(str.ptr, str.len, x, y); } -extern fn textUtf8(strPtr: [*]const u8, strLen: usize, x: u32, y: u32) void; +extern fn textUtf8(strPtr: [*]const u8, strLen: usize, x: i32, y: i32) void; /// Draws a vertical line pub extern fn vline(x: u32, y: u32, len: u32) void;