2-layer map, more tiled-integration on player collision and viewport

master
Josha von Gizycki 6 years ago
parent 85c3ad5e5d
commit eb924c7a54

@ -0,0 +1,140 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.1" tiledversion="2018.09.12" orientation="orthogonal" renderorder="right-down" width="30" height="24" tilewidth="16" tileheight="16" infinite="0" nextlayerid="26" nextobjectid="62">
<tileset firstgid="1" name="pokelike" tilewidth="16" tileheight="16" tilecount="1600" columns="40">
<image source="PokemonLike.png" width="640" height="640"/>
<terraintypes>
<terrain name="Base" tile="0"/>
<terrain name="Gras" tile="1"/>
<terrain name="Feld" tile="40"/>
<terrain name="Sand" tile="200"/>
<terrain name="Dreck" tile="44"/>
<terrain name="Buschwerk" tile="80"/>
</terraintypes>
<tile id="1" terrain="1,1,1,1"/>
<tile id="2" terrain="1,1,1,1"/>
<tile id="40" terrain="2,2,2,2"/>
<tile id="41" terrain="2,2,2,2"/>
<tile id="42" terrain="2,2,2,2"/>
<tile id="44" terrain="4,4,4,4"/>
<tile id="45" terrain="4,4,4,4"/>
<tile id="80" terrain="5,5,5,5"/>
<tile id="81" terrain="5,5,5,5"/>
<tile id="200" terrain="3,3,3,3"/>
<tile id="201" terrain="3,3,3,3"/>
<tile id="333">
<objectgroup draworder="index">
<object id="1" x="0" y="0" width="16" height="16"/>
</objectgroup>
</tile>
<tile id="334">
<objectgroup draworder="index">
<object id="3" x="0" y="0" width="16" height="16"/>
</objectgroup>
</tile>
<tile id="335">
<objectgroup draworder="index">
<object id="1" x="0" y="0" width="16" height="16"/>
</objectgroup>
</tile>
<tile id="488">
<objectgroup draworder="index">
<object id="1" x="0" y="0" width="16"/>
</objectgroup>
</tile>
<tile id="527">
<objectgroup draworder="index">
<object id="2" x="16" y="0" height="16"/>
</objectgroup>
</tile>
<tile id="778">
<animation>
<frame tileid="775" duration="250"/>
<frame tileid="776" duration="250"/>
<frame tileid="777" duration="250"/>
<frame tileid="778" duration="250"/>
</animation>
</tile>
<tile id="819">
<animation>
<frame tileid="816" duration="250"/>
<frame tileid="817" duration="250"/>
<frame tileid="818" duration="250"/>
<frame tileid="819" duration="250"/>
</animation>
</tile>
</tileset>
<layer id="22" name="Hintergrund" width="30" height="24">
<data encoding="csv">
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,43,43,42,43,43,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,41,43,41,41,42,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,42,41,43,42,42,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,1,2,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,2,3,3,2,2,3,2,2,2,3,1,2,2,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,3,2,3,2,2,2,3,3,2,1,2,2,2,1,
1,1,1,1,1,2,2,2,1,1,1,1,1,1,2,3,3,1,1,1,1,1,2,3,3,1,3,1,3,2,
1,1,1,1,1,3,2,3,1,1,1,1,1,1,2,2,3,1,1,1,1,1,3,1,2,1,3,2,3,3,
1,1,1,1,1,2,3,2,1,1,1,1,1,1,3,2,3,1,1,1,1,1,3,3,3,1,3,1,2,3,
1,1,1,1,1,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,2,1,
1,1,1,1,1,2,3,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,3,3,1,3,1,
1,1,1,1,1,2,3,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,2,1,2,2,1,
1,1,1,1,1,3,3,3,3,3,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,3,1,2,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,2,2,2,3,3,3,3,3,2,3,2,2,3,3,2,3,2,2,3,2,2,3,2,3,3,
1,1,1,1,1,2,2,2,2,2,3,2,3,3,3,2,3,3,2,3,2,2,2,3,3,2,3,3,2,3,
1,1,1,1,1,3,3,3,2,2,3,2,2,2,2,3,3,3,2,2,3,2,3,2,2,3,3,3,1,1,
1,1,1,1,1,3,3,2,3,3,2,3,3,3,2,3,3,3,2,3,3,3,2,2,2,1,2,1,2,3,
1,1,1,1,1,2,3,2,3,2,3,2,3,2,2,3,3,2,2,3,3,2,2,2,3,1,1,2,3,3,
1,2,2,1,1,3,2,3,3,2,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,2,3,
3,3,2,3,1,1,3,3,2,2,2,3,2,3,2,3,2,3,2,2,3,1,2,2,3,3,2,2,3,2,
3,1,2,2,1,2,2,2,3,3,2,1,1,2,3,2,3,3,2,2,3,2,1,2,3,2,2,3,3,2,
3,2,2,2,1,2,3,3,2,3,2,2,2,2,3,3,2,3,3,2,3,2,2,3,2,2,2,2,1,3,
2,1,2,2,1,1,3,2,3,3,2,3,2,3,3,3,2,2,3,2,3,2,3,2,1,1,3,2,2,3
</data>
</layer>
<layer id="25" name="Vordergrund" width="30" height="24">
<data encoding="csv">
42,41,43,41,42,43,43,41,41,41,42,43,43,41,42,41,43,41,42,43,43,43,42,42,41,0,0,0,0,0,
43,41,41,42,41,41,43,42,41,41,41,41,41,42,43,42,41,42,42,43,43,41,41,42,41,0,0,0,0,0,
41,43,41,42,41,41,43,41,43,42,43,42,41,42,43,42,43,43,41,41,41,43,43,42,42,0,0,0,0,0,
41,42,42,42,41,43,43,41,42,42,41,43,43,82,82,82,82,82,81,82,81,81,82,81,82,0,0,0,42,43,
43,43,43,43,43,42,43,43,43,43,41,42,43,81,337,338,339,0,0,52,0,10,11,82,81,0,0,43,43,41,
43,43,41,41,81,82,82,82,82,43,43,42,41,81,0,0,0,0,0,0,52,50,51,81,10,11,0,0,42,41,
42,43,41,43,82,0,0,0,82,43,43,43,41,82,0,0,0,486,487,488,489,490,82,82,50,51,0,0,0,0,
42,43,42,43,81,0,0,0,82,42,43,42,41,82,0,0,0,526,527,528,529,530,7,8,9,10,11,0,0,0,
41,42,43,42,81,0,0,0,81,43,42,41,42,82,615,615,615,566,567,568,569,570,47,48,49,50,51,0,0,0,
42,42,42,43,82,0,0,0,81,41,43,41,43,82,0,0,0,0,328,334,335,336,0,0,0,573,0,0,0,0,
42,42,43,43,81,0,0,0,81,43,43,41,43,82,0,780,0,0,328,0,0,0,0,0,0,573,0,0,0,0,
82,82,81,82,82,0,0,0,82,81,82,82,698,82,0,0,0,0,328,0,0,0,0,0,0,613,615,615,615,615,
0,0,3,0,0,0,0,0,0,0,0,0,328,0,0,0,0,0,328,0,0,0,0,0,0,0,0,0,0,0,
367,367,367,367,367,367,367,367,367,367,367,367,368,367,367,367,367,367,368,369,369,369,369,369,369,367,367,367,367,367,
3,0,0,3,0,0,0,0,0,0,0,0,408,583,587,587,587,453,454,455,456,587,0,0,0,0,0,0,0,0,
81,82,81,82,82,0,0,0,0,0,0,0,408,626,166,0,0,493,494,495,496,625,0,0,0,10,11,7,8,9,
2,2,2,2,82,0,0,0,0,0,0,0,408,626,0,0,0,533,534,535,536,625,0,0,0,50,51,47,48,49,
2,3,3,2,82,0,0,0,0,0,0,0,407,369,369,369,369,369,409,0,0,625,0,0,0,10,11,0,0,0,
3,2,3,0,81,0,0,0,0,0,0,0,0,666,664,664,664,664,664,664,664,665,0,0,0,50,51,0,0,0,
0,0,0,0,81,7,8,9,10,11,7,8,9,7,8,9,10,11,7,8,9,10,11,7,8,9,0,0,0,0,
0,0,0,0,81,47,48,49,50,51,47,48,49,47,48,49,50,51,47,48,49,50,51,47,48,49,0,0,0,0,
0,0,0,0,81,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,81,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,82,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
</data>
</layer>
<objectgroup id="9" name="Objektebene 1">
<object id="36" x="80" y="80" width="64" height="16"/>
<object id="37" x="128" y="96" width="16" height="96"/>
<object id="38" x="144" y="176" width="48" height="16"/>
<object id="39" x="208" y="128" width="16" height="64"/>
<object id="41" x="208" y="224" width="16" height="48"/>
<object id="42" x="208" y="288" width="144" height="16"/>
<object id="43" x="224" y="224" width="48" height="16"/>
<object id="44" x="272" y="224" width="64" height="48"/>
<object id="45" x="336" y="224" width="16" height="64"/>
<object id="47" x="304" y="144" width="48" height="16"/>
<object id="49" x="224" y="128" width="176" height="16"/>
<object id="50" x="64" y="48" width="16" height="256"/>
<object id="52" x="80" y="32" width="128" height="16"/>
<object id="53" x="208" y="48" width="16" height="80"/>
<object id="55" x="80" y="304" width="320" height="16"/>
<object id="61" x="400" y="128" width="16" height="192"/>
</objectgroup>
</map>

@ -14,21 +14,9 @@
"y":0 "y":0
}, },
{ {
"data":[42, 41, 43, 41, 42, 43, 43, 41, 41, 41, 42, 43, 43, 41, 42, 41, 43, 41, 42, 43, 43, 43, 42, 42, 41, 0, 0, 0, 0, 0, 43, 41, 41, 42, 41, 41, 43, 42, 41, 41, 41, 41, 41, 42, 43, 42, 41, 42, 42, 43, 43, 41, 41, 42, 41, 0, 0, 0, 0, 0, 41, 43, 41, 42, 41, 41, 43, 41, 43, 42, 43, 42, 41, 42, 43, 42, 43, 43, 41, 41, 41, 43, 43, 42, 42, 0, 0, 0, 0, 0, 41, 42, 42, 42, 41, 43, 43, 41, 42, 42, 41, 43, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 43, 43, 43, 43, 42, 43, 43, 43, 43, 41, 42, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 43, 41, 41, 0, 0, 0, 0, 0, 43, 43, 42, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 43, 41, 43, 0, 0, 0, 0, 0, 43, 43, 43, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 43, 42, 43, 0, 0, 0, 0, 0, 42, 43, 42, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 41, 42, 43, 42, 0, 0, 0, 0, 0, 43, 42, 41, 42, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, 42, 43, 0, 0, 0, 0, 0, 41, 43, 41, 43, 0, 0, 0, 0, 0, 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 42, 43, 43, 0, 0, 0, 0, 0, 43, 43, 41, 43, 0, 0, 0, 0, 0, 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 698, 0, 0, 0, 0, 0, 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 328, 0, 0, 0, 0, 0, 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 367, 367, 367, 367, 367, 367, 367, 367, 367, 367, 367, 367, 368, 367, 367, 367, 367, 367, 368, 369, 369, 369, 369, 369, 369, 367, 367, 367, 367, 367, 3, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 408, 0, 0, 0, 0, 584, 0, 0, 584, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 408, 626, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 408, 626, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 407, 369, 369, 369, 369, 369, 409, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 666, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], "data":[42, 41, 43, 41, 42, 43, 43, 41, 41, 41, 42, 43, 43, 41, 42, 41, 43, 41, 42, 43, 43, 43, 42, 42, 41, 0, 0, 0, 0, 0, 43, 41, 41, 42, 41, 41, 43, 42, 41, 41, 41, 41, 41, 42, 43, 42, 41, 42, 42, 43, 43, 41, 41, 42, 41, 0, 0, 0, 0, 0, 41, 43, 41, 42, 41, 41, 43, 41, 43, 42, 43, 42, 41, 42, 43, 42, 43, 43, 41, 41, 41, 43, 43, 42, 42, 0, 0, 0, 0, 0, 41, 42, 42, 42, 41, 43, 43, 41, 42, 42, 41, 43, 43, 82, 82, 82, 82, 82, 81, 82, 81, 81, 82, 81, 82, 0, 0, 0, 42, 43, 43, 43, 43, 43, 43, 42, 43, 43, 43, 43, 41, 42, 43, 81, 337, 338, 339, 0, 0, 52, 0, 10, 11, 82, 81, 0, 0, 43, 43, 41, 43, 43, 41, 41, 81, 82, 82, 82, 82, 43, 43, 42, 41, 81, 0, 0, 0, 0, 0, 0, 52, 50, 51, 81, 10, 11, 0, 0, 42, 41, 42, 43, 41, 43, 82, 0, 0, 0, 82, 43, 43, 43, 41, 82, 0, 0, 0, 486, 487, 488, 489, 490, 82, 82, 50, 51, 0, 0, 0, 0, 42, 43, 42, 43, 81, 0, 0, 0, 82, 42, 43, 42, 41, 82, 0, 0, 0, 526, 527, 528, 529, 530, 7, 8, 9, 10, 11, 0, 0, 0, 41, 42, 43, 42, 81, 0, 0, 0, 81, 43, 42, 41, 42, 82, 615, 615, 615, 566, 567, 568, 569, 570, 47, 48, 49, 50, 51, 0, 0, 0, 42, 42, 42, 43, 82, 0, 0, 0, 81, 41, 43, 41, 43, 82, 0, 0, 0, 0, 328, 334, 335, 336, 0, 0, 0, 573, 0, 0, 0, 0, 42, 42, 43, 43, 81, 0, 0, 0, 81, 43, 43, 41, 43, 82, 0, 780, 0, 0, 328, 0, 0, 0, 0, 0, 0, 573, 0, 0, 0, 0, 82, 82, 81, 82, 82, 0, 0, 0, 82, 81, 82, 82, 698, 82, 0, 0, 0, 0, 328, 0, 0, 0, 0, 0, 0, 613, 615, 615, 615, 615, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 328, 0, 0, 0, 0, 0, 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 367, 367, 367, 367, 367, 367, 367, 367, 367, 367, 367, 367, 368, 367, 367, 367, 367, 367, 368, 369, 369, 369, 369, 369, 369, 367, 367, 367, 367, 367, 3, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 408, 583, 587, 587, 587, 453, 454, 455, 456, 587, 0, 0, 0, 0, 0, 0, 0, 0, 81, 82, 81, 82, 82, 0, 0, 0, 0, 0, 0, 0, 408, 626, 166, 0, 0, 493, 494, 495, 496, 625, 0, 0, 0, 10, 11, 7, 8, 9, 2, 2, 2, 2, 82, 0, 0, 0, 0, 0, 0, 0, 408, 626, 0, 0, 0, 533, 534, 535, 536, 625, 0, 0, 0, 50, 51, 47, 48, 49, 2, 3, 3, 2, 82, 0, 0, 0, 0, 0, 0, 0, 407, 369, 369, 369, 369, 369, 409, 0, 0, 625, 0, 0, 0, 10, 11, 0, 0, 0, 3, 2, 3, 0, 81, 0, 0, 0, 0, 0, 0, 0, 0, 666, 664, 664, 664, 664, 664, 664, 664, 665, 0, 0, 0, 50, 51, 0, 0, 0, 0, 0, 0, 0, 81, 7, 8, 9, 10, 11, 7, 8, 9, 7, 8, 9, 10, 11, 7, 8, 9, 10, 11, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 81, 47, 48, 49, 50, 51, 47, 48, 49, 47, 48, 49, 50, 51, 47, 48, 49, 50, 51, 47, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"height":24, "height":24,
"id":23, "id":25,
"name":"Dekoration",
"opacity":1,
"type":"tilelayer",
"visible":true,
"width":30,
"x":0,
"y":0
},
{
"data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 82, 82, 82, 82, 81, 82, 81, 81, 82, 81, 82, 0, 0, 0, 42, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, 337, 338, 339, 0, 0, 52, 0, 10, 11, 82, 81, 0, 0, 43, 43, 41, 0, 0, 0, 0, 81, 82, 82, 82, 82, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 52, 50, 51, 81, 10, 11, 0, 0, 42, 41, 0, 0, 0, 0, 82, 0, 0, 0, 82, 0, 0, 0, 0, 82, 0, 0, 0, 486, 487, 488, 489, 490, 82, 82, 50, 51, 0, 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, 0, 82, 0, 0, 0, 0, 82, 0, 0, 0, 526, 527, 528, 529, 530, 7, 8, 9, 10, 11, 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, 0, 81, 0, 0, 0, 0, 82, 615, 615, 615, 566, 567, 568, 569, 570, 47, 48, 49, 50, 51, 0, 0, 0, 0, 0, 0, 0, 82, 0, 0, 0, 81, 0, 0, 0, 0, 82, 0, 0, 0, 0, 0, 334, 335, 336, 0, 0, 0, 573, 0, 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, 0, 81, 0, 0, 0, 0, 82, 0, 780, 0, 0, 0, 0, 0, 0, 0, 0, 0, 573, 0, 0, 0, 0, 82, 82, 81, 82, 82, 0, 0, 0, 82, 81, 82, 82, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 613, 615, 615, 615, 615, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 583, 587, 587, 587, 453, 454, 455, 456, 587, 0, 0, 0, 0, 0, 0, 0, 0, 81, 82, 81, 82, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 166, 0, 0, 493, 494, 495, 496, 625, 0, 0, 0, 10, 11, 7, 8, 9, 0, 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 533, 534, 535, 536, 625, 0, 0, 0, 50, 51, 47, 48, 49, 0, 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 625, 0, 0, 0, 10, 11, 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 664, 664, 664, 664, 664, 664, 664, 665, 0, 0, 0, 50, 51, 0, 0, 0, 0, 0, 0, 0, 81, 7, 8, 9, 10, 11, 7, 8, 9, 7, 8, 9, 10, 11, 7, 8, 9, 10, 11, 7, 8, 9, 0, 0, 0, 0, 0, 0, 0, 0, 81, 47, 48, 49, 50, 51, 47, 48, 49, 47, 48, 49, 50, 51, 47, 48, 49, 50, 51, 47, 48, 49, 0, 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"height":24,
"id":24,
"name":"Vordergrund", "name":"Vordergrund",
"opacity":1, "opacity":1,
"type":"tilelayer", "type":"tilelayer",
@ -224,7 +212,7 @@
"x":0, "x":0,
"y":0 "y":0
}], }],
"nextlayerid":25, "nextlayerid":26,
"nextobjectid":62, "nextobjectid":62,
"orientation":"orthogonal", "orientation":"orthogonal",
"renderorder":"right-down", "renderorder":"right-down",

@ -19,6 +19,7 @@
:zoom 3} :zoom 3}
:player {:x (- (/ (get-in gamestate [:dimensions :w]) 2) 32) :player {:x (- (/ (get-in gamestate [:dimensions :w]) 2) 32)
:y (- (/ (get-in gamestate [:dimensions :h]) 2) 32) :y (- (/ (get-in gamestate [:dimensions :h]) 2) 32)
:w 0 :h 0
:d :s :d :s
:animation {:ids {:s 778 :n 778 :animation {:ids {:s 778 :n 778
:e 819 :w 819} :e 819 :w 819}
@ -28,7 +29,7 @@
:viewport {:keep-in {:x 0 :y 0 :viewport {:keep-in {:x 0 :y 0
:w 0 :h 0} :w 0 :h 0}
:tileset :pokelike :tileset :pokelike
:x (* 16 6 3) :y (* 16 9 3) :x 6 :y 9
:w (get-in gamestate [:dimensions :w]) :w (get-in gamestate [:dimensions :w])
:h (get-in gamestate [:dimensions :h]) :h (get-in gamestate [:dimensions :h])
:d :? :d :?
@ -54,13 +55,19 @@
(if (and (not (get-in scenestate [:map-def :def])) (if (and (not (get-in scenestate [:map-def :def]))
(some? @map-def)) (some? @map-def))
(let [loaded-def (walk/keywordize-keys @map-def) (let [loaded-def (walk/keywordize-keys @map-def)
zoom (get-in scenestate [:map-def :zoom])] zoom (get-in scenestate [:map-def :zoom])
{mw :width mh :height
tw :tilewidth th :tileheight} loaded-def]
(-> scenestate (-> scenestate
(assoc-in [:map-def :def] loaded-def) (assoc-in [:map-def :def] loaded-def)
(update-in [:map-def :def] (update-in [:map-def :def]
(partial tileset/prepare-map-def zoom)) (partial tileset/prepare-map-def zoom))
(assoc-in [:viewport :keep-in :w] (* (dec (:width loaded-def)) 3 16)) (assoc-in [:viewport :keep-in :w] (* (dec mw) zoom tw))
(assoc-in [:viewport :keep-in :h] (* (dec (:height loaded-def)) 3 16)))) (assoc-in [:viewport :keep-in :h] (* (dec mh) zoom th))
(update-in [:viewport :x] * tw zoom)
(update-in [:viewport :y] * th zoom)
(assoc-in [:player :w] (- tw 2))
(assoc-in [:player :h] (- th 2))))
scenestate)) scenestate))
(defn update-scene [gamestate scenestate] (defn update-scene [gamestate scenestate]
@ -68,7 +75,6 @@
player (:player new-scenestate) player (:player new-scenestate)
viewport (:viewport new-scenestate) viewport (:viewport new-scenestate)
dir (get-in gamestate [:input :dir])] dir (get-in gamestate [:input :dir])]
(println viewport)
(assoc new-scenestate (assoc new-scenestate
:player (update-player gamestate player dir) :player (update-player gamestate player dir)
:viewport (update-viewport gamestate viewport dir)))) :viewport (update-viewport gamestate viewport dir))))

Loading…
Cancel
Save