start on maps bigger than the camera more properly

Signed-off-by: Xe Iaso <me@christine.website>
This commit is contained in:
Cadey Ratio 2022-07-02 08:16:29 -04:00
parent 4ec1a99040
commit 4d174c5ee1
5 changed files with 321 additions and 123 deletions

View File

@ -1,35 +1,55 @@
{ "compressionlevel":-1,
"height":20,
"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,
35, 36, 73, 74, 35, 36, 171, 172, 35, 36, 105, 106, 107, 108, 109, 110, 35, 39, 40, 172,
69, 70, 205, 206, 69, 70, 205, 206, 69, 70, 139, 140, 207, 208, 143, 144, 69, 73, 74, 206,
103, 104, 239, 240, 103, 104, 239, 240, 103, 104, 173, 174, 241, 242, 177, 178, 103, 104, 239, 240,
137, 138, 137, 138, 307, 274, 137, 138, 341, 342, 345, 346, 411, 412, 137, 138, 1, 2, 33, 34,
171, 172, 171, 172, 307, 307, 171, 172, 375, 376, 379, 380, 445, 446, 171, 172, 35, 36, 67, 68,
205, 206, 205, 206, 69, 70, 205, 206, 413, 414, 39, 40, 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,
1, 2, 137, 307, 1, 2, 73, 74, 413, 414, 137, 39, 40, 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,
69, 70, 205, 206, 69, 70, 274, 206, 413, 414, 235, 236, 233, 234, 205, 364, 365, 366, 367, 206,
103, 104, 239, 240, 39, 40, 239, 240, 447, 448, 269, 270, 267, 268, 397, 398, 399, 400, 401, 402,
1, 2, 237, 238, 73, 74, 137, 138, 413, 414, 233, 234, 235, 236, 431, 432, 433, 434, 435, 436,
35, 36, 271, 272, 35, 353, 354, 172, 447, 448, 267, 268, 269, 270, 465, 466, 467, 468, 469, 470,
69, 70, 351, 352, 69, 387, 388, 206, 347, 348, 349, 350, 343, 344, 499, 500, 439, 440, 503, 504,
103, 104, 385, 386, 103, 104, 239, 240, 381, 121, 121, 121, 121, 378, 403, 404, 473, 474, 405, 406,
1, 2, 409, 410, 345, 346, 345, 346, 417, 121, 121, 121, 121, 418, 345, 346, 417, 418, 345, 346,
35, 36, 443, 444, 379, 380, 379, 380, 451, 452, 451, 452, 451, 452, 379, 380, 451, 452, 379, 380,
69, 57, 58, 206, 69, 70, 205, 206, 69, 307, 205, 206, 69, 70, 205, 206, 39, 40, 205, 206,
90, 91, 92, 93, 103, 104, 57, 58, 103, 104, 239, 240, 103, 104, 239, 240, 73, 74, 239, 240],
"height":20,
"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, 103, 104, 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":20,
"width":40,
"x":0,
"y":0
},
@ -316,8 +336,8 @@
"rotation":0,
"visible":true,
"width":14.978,
"x":96.4757577092511,
"y":17.0704605726872
"x":96.4758,
"y":17.0705
}],
"opacity":1,
"type":"objectgroup",
@ -338,8 +358,8 @@
"rotation":0,
"visible":true,
"width":16,
"x":32,
"y":32
"x":72,
"y":64
}],
"opacity":1,
"type":"objectgroup",
@ -361,5 +381,5 @@
"tilewidth":8,
"type":"map",
"version":"1.9",
"width":20
"width":40
}

View File

@ -1,31 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.9" tiledversion="1.9.0" orientation="orthogonal" renderorder="right-down" width="20" height="20" tilewidth="8" tileheight="8" infinite="0" nextlayerid="6" nextobjectid="36">
<map version="1.9" tiledversion="1.9.0" orientation="orthogonal" renderorder="right-down" width="40" height="40" tilewidth="8" tileheight="8" infinite="0" nextlayerid="6" nextobjectid="36">
<editorsettings>
<export target="RPGmap.json" format="json"/>
</editorsettings>
<tileset firstgid="1" source="../sprites/kenney_rpg.tsx"/>
<layer id="1" name="map" width="20" height="20">
<layer id="1" name="map" width="40" height="40">
<data encoding="csv">
1,2,39,40,1,2,137,138,1,2,71,72,73,74,75,76,1,2,137,138,
35,36,73,74,35,36,171,172,35,36,105,106,107,108,109,110,35,39,40,172,
69,70,205,206,69,70,205,206,69,70,139,140,207,208,143,144,69,73,74,206,
103,104,239,240,103,104,239,240,103,104,173,174,241,242,177,178,103,104,239,240,
137,138,137,138,307,274,137,138,341,342,345,346,411,412,137,138,1,2,33,34,
171,172,171,172,307,307,171,172,375,376,379,380,445,446,171,172,35,36,67,68,
205,206,205,206,69,70,205,206,413,414,39,40,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,
1,2,137,307,1,2,73,74,413,414,137,39,40,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,
69,70,205,206,69,70,274,206,413,414,235,236,233,234,205,364,365,366,367,206,
103,104,239,240,39,40,239,240,447,448,269,270,267,268,397,398,399,400,401,402,
1,2,237,238,73,74,137,138,413,414,233,234,235,236,431,432,433,434,435,436,
35,36,271,272,35,353,354,172,447,448,267,268,269,270,465,466,467,468,469,470,
69,70,351,352,69,387,388,206,347,348,349,350,343,344,499,500,439,440,503,504,
103,104,385,386,103,104,239,240,381,121,121,121,121,378,403,404,473,474,405,406,
1,2,409,410,345,346,345,346,417,121,121,121,121,418,345,346,417,418,345,346,
35,36,443,444,379,380,379,380,451,452,451,452,451,452,379,380,451,452,379,380,
69,57,58,206,69,70,205,206,69,307,205,206,69,70,205,206,39,40,205,206,
90,91,92,93,103,104,57,58,103,104,239,240,103,104,239,240,73,74,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,103,104,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
</data>
</layer>
<objectgroup id="2" name="coll">
@ -74,6 +94,6 @@
</object>
</objectgroup>
<objectgroup id="4" name="spc">
<object id="33" name="mara_start" x="32" y="32" width="16" height="16"/>
<object id="33" name="mara_start" x="72" y="64" width="16" height="16"/>
</objectgroup>
</map>

View File

@ -17,7 +17,8 @@ var frame_count: u32 = 0;
var mara_direction: Direction = Direction.Right;
var mara_frame: bool = false;
var mara_box: Rect = Rect{.base = map.start_point, .width = 16, .height = 16};
var mara_speed: u16 = 0;
var mara_speed: i16 = 0;
var old_speed: i16 = 0;
var screen = Rect{.base = Point{.x = 0, .y = 0}, .width = 160, .height = 160};
const screen_width = 20;
@ -28,12 +29,20 @@ var sound_timer: u8 = 0;
var textBuf: [160]u8 = undefined;
var done: bool = false;
var camera: [400]u9 = []u9{} ** 400;
var camera = Point{.x = 0, .y = 0};
var state: sh0rk.State = .Title;
var state: sh0rk.State = .Gameplay;
fn world_to_screen(p: Point) Point {
p.sub(camera);
}
fn screen_to_world(p: Point) Point {
p.add(camera);
}
export fn start() void {
palette.tamtam();
palette.mist();
}
fn bonk() void {
@ -79,26 +88,44 @@ fn drawMap() !void {
defer row += 1;
var tile = map.data[col * map.width + row];
var tileX = tile % map.ts_width;
var tileY = tile / map.ts_width;
// if (!done) {
// var buf = fmt.bufPrint(&textBuf, "{},{}: {}: {},{}", .{col, row, tile, tileX, tileY}) catch unreachable;
// w4.trace(buf);
// }
w4.blitSub(
draw_tile(tile, row * 8, col * 8);
}
}
}
fn draw_tile(tile: u32, x: u32, y: u32) void {
var tileX = tile % map.ts_width;
var tileY = tile / map.ts_width;
switch (map.tileset) {
.Rpg => w4.blitSub(
&sprites.kenney_rpg,
row * 8,
col * 8,
x,
y,
8,
8,
@intCast(u32, tileX) * 8,
@intCast(u32, tileY) * 8,
sprites.kenney_rpg_width,
w4.BlitFlags{.two_bits = true},
);
}
),
.Dungeon => w4.blitSub(
&sprites.dungeon,
x,
y,
8,
8,
@intCast(u32, tileX) * 8,
@intCast(u32, tileY) * 8,
sprites.dungeon_width,
w4.BlitFlags{.two_bits = true},
),
}
}
@ -210,6 +237,8 @@ fn storydump() !void {
}
export fn update() void {
defer frame_count += 1;
switch (state) {
.Title => title() catch unreachable,
.StoryDump => storydump() catch unreachable,
@ -226,7 +255,6 @@ fn gameplay() !void {
drawMap() catch unreachable;
const gamepad = w4.m.gamepads[0];
const old_speed = mara_speed;
if (!tframe.enabled) {
move_mara(gamepad);
@ -261,32 +289,36 @@ fn gameplay() !void {
}
}
if (mara_box.base.x < 0) {
if (mara_box.base.x <= 0) {
mara_box.base.x = 0;
bonk();
} else if (mara_box.base.x > 160 - mara_box.width) {
mara_box.base.x = 160 - mara_box.width;
bonk();
}
if (mara_box.base.y < 0) {
mara_box.base.y = 0;
bonk();
} else if (mara_box.base.y > 160 - mara_box.height) {
mara_box.base.y = 160 - mara_box.height;
bonk();
}
if (mara_box.base.y <= 0) {
mara_box.base.y = 0;
bonk();
}
draw_mara();
}
fn draw_glaceon(p: Point) void {
palette.mist();
w4.m.colors.* = .{
._0 = .p0,
._1 = .p1,
._2 = .p3,
._3 = .transparent,
};
w4.blit(&sprites.glaceon, p.x, p.y, sprites.glaceon_width, sprites.glaceon_height, w4.BlitFlags{.two_bits = true});
}
fn draw_mara() void {
var flags: w4.BlitFlags = w4.BlitFlags {
.two_bits = true,
};
// w4.m.colors._0 = .p0;
// w4.m.colors._1 = .p1;
// w4.m.colors._2 = .p3;
// w4.m.colors._3 = .transparent;
// w4.blit(&sprites.glaceon, 0, 0, sprites.glaceon_width, sprites.glaceon_height, flags);
w4.m.colors.* = .{
._0 = .transparent,
._1 = .p0,
@ -298,11 +330,7 @@ fn gameplay() !void {
flags.flip_x = true;
}
if (frame_count % 15 == 0 and mara_speed > 0) {
mara_frame = !mara_frame;
}
if (old_speed != mara_speed) {
if (frame_count % 32 == 0 and mara_speed > 0) {
mara_frame = !mara_frame;
}
@ -315,7 +343,4 @@ fn gameplay() !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);
frame_count += 1;
}

View File

@ -7,54 +7,174 @@ const Tileset = sh0rk.Tileset;
const Trigger = sh0rk.Trigger;
const Rect = sh0rk.Rect;
pub const width = 20;
pub const height = 20;
pub const width = 40;
pub const height = 40;
pub const tileset: Tileset = .Rpg;
pub const ts_width = 34;
pub const ts_height = 16;
pub const data = [400]u9{
pub const data = [1600]u9{
0, 1, 38, 39, 0, 1, 136, 137, 0, 1, 70,
71, 72, 73, 74, 75, 0, 1, 136, 137, 34,
71, 72, 73, 74, 75, 0, 1, 136, 137, 0,
1, 136, 137, 0, 1, 136, 137, 0, 1, 136,
137, 0, 1, 136, 137, 0, 1, 136, 137, 34,
35, 72, 73, 34, 35, 170, 171, 34, 35, 104,
105, 106, 107, 108, 109, 34, 38, 39, 171, 68,
105, 106, 107, 108, 109, 34, 38, 39, 171, 34,
35, 170, 171, 34, 35, 170, 171, 34, 35, 170,
171, 34, 35, 170, 171, 34, 35, 170, 171, 68,
69, 204, 205, 68, 69, 204, 205, 68, 69, 138,
139, 206, 207, 142, 143, 68, 72, 73, 205, 102,
139, 206, 207, 142, 143, 68, 72, 73, 205, 68,
69, 204, 205, 68, 69, 204, 205, 68, 69, 204,
205, 68, 69, 204, 205, 68, 69, 204, 205, 102,
103, 238, 239, 102, 103, 238, 239, 102, 103, 172,
173, 240, 241, 176, 177, 102, 103, 238, 239, 136,
173, 240, 241, 176, 177, 102, 103, 238, 239, 102,
103, 238, 239, 102, 103, 238, 239, 102, 103, 238,
239, 102, 103, 238, 239, 102, 103, 238, 239, 136,
137, 136, 137, 306, 273, 136, 137, 340, 341, 344,
345, 410, 411, 136, 137, 0, 1, 32, 33, 170,
345, 410, 411, 136, 137, 0, 1, 32, 33, 0,
1, 136, 137, 0, 1, 136, 137, 0, 1, 136,
137, 0, 1, 136, 137, 0, 1, 136, 137, 170,
171, 170, 171, 306, 306, 170, 171, 374, 375, 378,
379, 444, 445, 170, 171, 34, 35, 66, 67, 204,
379, 444, 445, 170, 171, 34, 35, 66, 67, 34,
35, 170, 171, 34, 35, 170, 171, 34, 35, 170,
171, 34, 35, 170, 171, 34, 35, 170, 171, 204,
205, 204, 205, 68, 69, 204, 205, 412, 413, 38,
39, 68, 69, 204, 205, 68, 69, 204, 205, 238,
39, 68, 69, 204, 205, 68, 69, 204, 205, 68,
69, 204, 205, 68, 69, 204, 205, 68, 69, 204,
205, 68, 69, 204, 205, 68, 69, 204, 205, 238,
239, 238, 239, 102, 103, 38, 39, 446, 447, 72,
73, 306, 103, 238, 273, 102, 103, 238, 239, 0,
73, 306, 103, 238, 273, 102, 103, 238, 239, 102,
103, 238, 239, 102, 103, 238, 239, 102, 103, 238,
239, 102, 103, 238, 239, 102, 103, 238, 239, 0,
1, 136, 306, 0, 1, 72, 73, 412, 413, 136,
38, 39, 1, 136, 137, 0, 1, 136, 137, 34,
38, 39, 1, 136, 137, 0, 1, 136, 137, 0,
1, 136, 137, 0, 1, 136, 137, 0, 1, 136,
137, 0, 1, 136, 137, 0, 1, 136, 137, 34,
35, 170, 171, 34, 35, 170, 171, 446, 447, 170,
72, 73, 35, 170, 171, 330, 331, 170, 171, 68,
72, 73, 35, 170, 171, 330, 331, 170, 171, 34,
35, 170, 171, 34, 35, 170, 171, 34, 35, 170,
171, 34, 35, 170, 171, 34, 35, 170, 171, 68,
69, 204, 205, 68, 69, 273, 205, 412, 413, 234,
235, 232, 233, 204, 363, 364, 365, 366, 205, 102,
235, 232, 233, 204, 363, 364, 365, 366, 205, 68,
69, 204, 205, 68, 69, 204, 205, 68, 69, 204,
205, 68, 69, 204, 205, 68, 69, 204, 205, 102,
103, 238, 239, 38, 39, 238, 239, 446, 447, 268,
269, 266, 267, 396, 397, 398, 399, 400, 401, 0,
269, 266, 267, 396, 397, 398, 399, 400, 401, 102,
103, 238, 239, 102, 103, 238, 239, 102, 103, 238,
239, 102, 103, 238, 239, 102, 103, 238, 239, 0,
1, 236, 237, 72, 73, 136, 137, 412, 413, 232,
233, 234, 235, 430, 431, 432, 433, 434, 435, 34,
233, 234, 235, 430, 431, 432, 433, 434, 435, 0,
1, 136, 137, 0, 1, 136, 137, 0, 1, 136,
137, 0, 1, 136, 137, 0, 1, 136, 137, 34,
35, 270, 271, 34, 352, 353, 171, 446, 447, 266,
267, 268, 269, 464, 465, 466, 467, 468, 469, 68,
267, 268, 269, 464, 465, 466, 467, 468, 469, 34,
35, 170, 171, 34, 35, 170, 171, 34, 35, 170,
171, 34, 35, 170, 171, 34, 35, 170, 171, 68,
69, 350, 351, 68, 386, 387, 205, 346, 347, 348,
349, 342, 343, 498, 499, 438, 439, 502, 503, 102,
349, 342, 343, 498, 499, 438, 439, 502, 503, 68,
69, 204, 205, 68, 69, 204, 205, 68, 69, 204,
205, 68, 69, 204, 205, 68, 69, 204, 205, 102,
103, 384, 385, 102, 103, 238, 239, 380, 120, 120,
120, 120, 377, 402, 403, 472, 473, 404, 405, 0,
120, 120, 377, 402, 403, 472, 473, 404, 405, 102,
103, 238, 239, 102, 103, 238, 239, 102, 103, 238,
239, 102, 103, 238, 239, 102, 103, 238, 239, 0,
1, 408, 409, 344, 345, 344, 345, 416, 120, 120,
120, 120, 417, 344, 345, 416, 417, 344, 345, 34,
120, 120, 417, 344, 345, 416, 417, 344, 345, 344,
345, 344, 345, 344, 345, 344, 345, 344, 345, 344,
345, 344, 345, 344, 345, 344, 345, 344, 345, 34,
35, 442, 443, 378, 379, 378, 379, 450, 451, 450,
451, 450, 451, 378, 379, 450, 451, 378, 379, 68,
451, 450, 451, 378, 379, 450, 451, 378, 379, 378,
379, 378, 379, 378, 379, 378, 379, 378, 379, 378,
379, 378, 379, 378, 379, 378, 379, 378, 379, 68,
56, 57, 205, 68, 69, 204, 205, 68, 306, 204,
205, 68, 69, 204, 205, 38, 39, 204, 205, 89,
205, 68, 69, 204, 205, 38, 39, 204, 205, 68,
69, 204, 205, 68, 69, 204, 205, 68, 69, 204,
205, 68, 69, 204, 205, 68, 69, 204, 205, 89,
90, 91, 92, 102, 103, 56, 57, 102, 103, 238,
239, 102, 103, 238, 239, 72, 73, 238, 239,
239, 102, 103, 238, 239, 72, 73, 238, 239, 102,
103, 238, 239, 102, 103, 238, 239, 102, 103, 238,
239, 102, 103, 238, 239, 102, 103, 238, 239, 90,
91, 90, 91, 90, 91, 90, 91, 92, 20, 136,
137, 0, 1, 136, 137, 0, 1, 136, 137, 0,
1, 136, 137, 0, 1, 136, 137, 0, 1, 136,
137, 0, 1, 136, 137, 0, 1, 136, 137, 124,
125, 124, 125, 124, 125, 124, 125, 126, 93, 170,
171, 34, 35, 170, 171, 34, 35, 170, 171, 34,
35, 170, 171, 34, 35, 170, 171, 34, 35, 170,
171, 34, 35, 170, 171, 34, 35, 170, 171, 158,
159, 158, 159, 158, 159, 158, 159, 69, 25, 204,
205, 68, 69, 204, 205, 68, 69, 204, 205, 68,
69, 204, 205, 68, 69, 204, 205, 68, 69, 204,
205, 68, 69, 204, 205, 68, 69, 204, 205, 102,
103, 238, 239, 102, 103, 238, 239, 102, 103, 238,
239, 102, 103, 238, 239, 102, 103, 238, 239, 102,
103, 238, 239, 102, 103, 238, 239, 102, 103, 238,
239, 102, 103, 238, 239, 102, 103, 238, 239, 0,
1, 136, 137, 0, 1, 136, 137, 0, 1, 136,
137, 0, 1, 136, 137, 0, 1, 136, 137, 0,
1, 136, 137, 0, 1, 136, 137, 0, 1, 136,
137, 0, 1, 136, 137, 0, 1, 136, 137, 34,
35, 170, 171, 34, 35, 170, 171, 34, 35, 170,
171, 34, 35, 170, 171, 34, 35, 170, 171, 34,
35, 170, 171, 34, 35, 170, 171, 34, 35, 170,
171, 34, 35, 170, 171, 34, 35, 170, 171, 68,
69, 204, 205, 68, 69, 204, 205, 68, 69, 204,
205, 68, 69, 204, 205, 68, 69, 204, 205, 68,
69, 204, 205, 68, 69, 204, 205, 68, 69, 204,
205, 68, 69, 204, 205, 68, 69, 204, 205, 102,
103, 238, 239, 102, 103, 238, 239, 102, 103, 238,
239, 102, 103, 238, 239, 102, 103, 238, 239, 102,
103, 238, 239, 102, 103, 238, 239, 102, 103, 238,
239, 102, 103, 238, 239, 102, 103, 238, 239, 0,
1, 136, 137, 0, 1, 136, 137, 0, 1, 136,
137, 0, 1, 136, 137, 0, 1, 136, 137, 0,
1, 136, 137, 0, 1, 136, 137, 0, 1, 136,
137, 0, 1, 136, 137, 0, 1, 136, 137, 34,
35, 170, 171, 34, 35, 170, 171, 34, 35, 170,
171, 34, 35, 170, 171, 34, 35, 170, 171, 34,
35, 170, 171, 34, 35, 170, 171, 34, 35, 170,
171, 34, 35, 170, 171, 34, 35, 170, 171, 68,
69, 204, 205, 68, 69, 204, 205, 68, 69, 204,
205, 68, 69, 204, 205, 68, 69, 204, 205, 68,
69, 204, 205, 68, 69, 204, 205, 68, 69, 204,
205, 68, 69, 204, 205, 68, 69, 204, 205, 102,
103, 238, 239, 102, 103, 238, 239, 102, 103, 238,
239, 102, 103, 238, 239, 102, 103, 238, 239, 102,
103, 238, 239, 102, 103, 238, 239, 102, 103, 238,
239, 102, 103, 238, 239, 102, 103, 238, 239, 0,
1, 136, 137, 0, 1, 136, 137, 0, 1, 136,
137, 0, 1, 136, 137, 0, 1, 136, 137, 0,
1, 136, 137, 0, 1, 136, 137, 0, 1, 136,
137, 0, 1, 136, 137, 0, 1, 136, 137, 34,
35, 170, 171, 34, 35, 170, 171, 34, 35, 170,
171, 34, 35, 170, 171, 34, 35, 170, 171, 34,
35, 170, 171, 34, 35, 170, 171, 34, 35, 170,
171, 34, 35, 170, 171, 34, 35, 170, 171, 68,
69, 204, 205, 68, 69, 204, 205, 68, 69, 204,
205, 68, 69, 204, 205, 68, 69, 204, 205, 68,
69, 204, 205, 68, 69, 204, 205, 68, 69, 204,
205, 68, 69, 204, 205, 68, 69, 204, 205, 102,
103, 238, 239, 102, 103, 238, 239, 102, 103, 238,
239, 102, 103, 238, 239, 102, 103, 238, 239, 102,
103, 238, 239, 102, 103, 238, 239, 102, 103, 238,
239, 102, 103, 238, 239, 102, 103, 238, 239, 0,
1, 136, 137, 0, 1, 136, 137, 0, 1, 136,
137, 0, 1, 136, 137, 0, 1, 136, 137, 0,
1, 136, 137, 0, 1, 136, 137, 0, 1, 136,
137, 0, 1, 136, 137, 0, 1, 136, 137, 34,
35, 170, 171, 34, 35, 170, 171, 34, 35, 170,
171, 34, 35, 170, 171, 34, 35, 170, 171, 34,
35, 170, 171, 34, 35, 170, 171, 34, 35, 170,
171, 34, 35, 170, 171, 34, 35, 170, 171, 68,
69, 204, 205, 68, 69, 204, 205, 68, 69, 204,
205, 68, 69, 204, 205, 68, 69, 204, 205, 68,
69, 204, 205, 68, 69, 204, 205, 68, 69, 204,
205, 68, 69, 204, 205, 68, 69, 204, 205, 102,
103, 238, 239, 102, 103, 238, 239, 102, 103, 238,
239, 102, 103, 238, 239, 102, 103, 238, 239, 102,
103, 238, 239, 102, 103, 238, 239, 102, 103, 238,
239, 102, 103, 238, 239, 102, 103, 238, 239,
};
pub const coll = [_]Rect{
@ -82,5 +202,5 @@ pub const triggers = [_]Trigger{
Trigger{.aura = Rect{.base = Point{.x = 96, .y = 103}, .width = 7, .height = 16}, .direction = Direction.Up, .dialogue = "Moar ded."}, // gravestone 2
};
pub const start_point = Point{ .x = 32, .y = 32 };
pub const start_point = Point{ .x = 72, .y = 64 };

View File

@ -1,7 +1,7 @@
pub const Point = packed struct {
x: u16,
y: u16,
pub fn init(x: u16, y: u16) @This() {
x: i16,
y: i16,
pub fn init(x: i16, y: i16) @This() {
return @This() {
.x = x,
.y = y,
@ -11,6 +11,20 @@ pub const Point = packed struct {
pub fn equals(this: @This(), other: @This()) bool {
return this.x == other.x and this.y == other.y;
}
pub fn add(this: @This(), other: @This()) @This() {
return @This() {
.x = this.x + other.x,
.y = this.y + other.y,
};
}
pub fn sub(this: @This(), other: @This()) @This() {
return @This() {
.x = this.x - other.x,
.y = this.y - other.y,
};
}
};
pub const Rect = packed struct {
@ -57,7 +71,6 @@ pub const Trigger = struct {
};
pub const Tileset = enum(u2) {
Cave,
Rpg,
Dungeon,
};