add camera system and optimize y sorting for rendering

This commit is contained in:
Quillraven
2025-05-30 00:18:12 +02:00
parent dc905f9c07
commit bcbac0fa90
14 changed files with 272 additions and 93 deletions

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.11" tiledversion="1.11.0" orientation="orthogonal" renderorder="right-down" width="18" height="16" tilewidth="16" tileheight="16" infinite="0" nextlayerid="7" nextobjectid="11">
<map version="1.10" tiledversion="1.11.0" orientation="orthogonal" renderorder="right-down" width="18" height="16" tilewidth="16" tileheight="16" infinite="0" nextlayerid="7" nextobjectid="11">
<tileset firstgid="1" source="objects.tsx"/>
<tileset firstgid="6" source="tileset.tsx"/>
<layer id="1" name="ground" width="18" height="16">
@@ -31,6 +31,7 @@
<object id="9" gid="5" x="32" y="32" width="16" height="16"/>
<object id="10" gid="2" x="25" y="214" width="32" height="32">
<properties>
<property name="camFollow" type="bool" value="true"/>
<property name="controller" type="bool" value="true"/>
</properties>
</object>

View File

@@ -4,7 +4,7 @@
<tile id="1" type="Object">
<properties>
<property name="animation" value="IDLE"/>
<property name="speed" type="float" value="2"/>
<property name="speed" type="float" value="3.5"/>
</properties>
<image source="objects/player.png" width="32" height="32"/>
<objectgroup draworder="index" id="2">
@@ -20,6 +20,9 @@
</objectgroup>
</tile>
<tile id="3" type="Prop">
<properties>
<property name="sortOffsetY" type="int" value="8"/>
</properties>
<image source="objects/oak_tree.png" width="64" height="80"/>
<objectgroup draworder="index" id="2">
<object id="2" x="24" y="63">

View File

@@ -1,28 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.11.1-99-gec89c545" orientation="orthogonal" renderorder="right-down" width="18" height="16" tilewidth="32" tileheight="32" infinite="0" nextlayerid="6" nextobjectid="3">
<tileset firstgid="1" source="tileset.tsx"/>
<tileset firstgid="99" source="objects.tsx"/>
<layer id="1" name="ground" width="18" height="16">
<data encoding="base64" compression="zlib">
eJx9k1EOgDAMQnuC0fufVj9c0jyhH426RmiBdVXpq/NWf89b7DXe3XfjHwHvGL5e+hfD9RR4Jyfx545acLjf1INcqr8W3CdhzRkFbrc3+elb0oN7J4+pjfNl027z12XM4au8rvOcZw6bnnBWzpw0Tr47zxKu67m7xDwkz1MuqWnCp5bprqQMu5mYGZfl2X8AE4YQ2w==
</data>
</layer>
<layer id="3" name="water" width="18" height="16">
<data encoding="base64" compression="zlib">
eJxjYBgFo2AUjIKBAQAEgAAB
</data>
</layer>
<layer id="4" name="water2" width="18" height="16">
<data encoding="base64" compression="zlib">
eJxjYBgFo2AUjIKBAQAEgAAB
</data>
</layer>
<layer id="2" name="props" width="18" height="16">
<data encoding="base64" compression="zlib">
eJxjYBgFo2AUjIKBAQAEgAAB
</data>
</layer>
<objectgroup id="5" name="objects">
<object id="2" gid="99" x="67.2153" y="411.713" width="64" height="64"/>
</objectgroup>
</map>

View File

@@ -1,6 +1,106 @@
<?xml version="1.0" encoding="UTF-8"?>
<tileset version="1.10" tiledversion="1.11.0" name="tileset" tilewidth="16" tileheight="16" spacing="16" margin="8" tilecount="128" columns="8">
<image source="tileset.png" width="256" height="512"/>
<tile id="0">
<objectgroup draworder="index" id="2">
<object id="1" x="8" y="9" width="8" height="7"/>
</objectgroup>
</tile>
<tile id="1">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="7" width="16" height="7"/>
</objectgroup>
</tile>
<tile id="2">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="9" width="8" height="7"/>
</objectgroup>
</tile>
<tile id="3">
<objectgroup draworder="index" id="2">
<object id="1" x="9" y="9" width="7" height="7"/>
</objectgroup>
</tile>
<tile id="4">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="7" width="16" height="7"/>
</objectgroup>
</tile>
<tile id="5">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="9" width="8" height="7"/>
</objectgroup>
</tile>
<tile id="8">
<objectgroup draworder="index" id="2">
<object id="1" x="8" y="0" width="4" height="16"/>
</objectgroup>
</tile>
<tile id="10">
<objectgroup draworder="index" id="2">
<object id="1" x="4" y="0" width="5" height="16"/>
</objectgroup>
</tile>
<tile id="11">
<objectgroup draworder="index" id="2">
<object id="1" x="7" y="0" width="5" height="16"/>
</objectgroup>
</tile>
<tile id="13">
<objectgroup draworder="index" id="2">
<object id="1" x="4" y="0" width="5" height="16"/>
</objectgroup>
</tile>
<tile id="16">
<objectgroup draworder="index" id="2">
<object id="1" x="9" y="0" width="7" height="8"/>
</objectgroup>
</tile>
<tile id="17">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="4" width="16" height="4"/>
</objectgroup>
</tile>
<tile id="18">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="0" width="7" height="7"/>
</objectgroup>
</tile>
<tile id="19">
<objectgroup draworder="index" id="2">
<object id="1" x="8" y="0" width="8" height="6"/>
</objectgroup>
</tile>
<tile id="20">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="6" width="16" height="4"/>
</objectgroup>
</tile>
<tile id="21">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="0" width="8" height="7"/>
</objectgroup>
</tile>
<tile id="24">
<objectgroup draworder="index" id="2">
<object id="1" x="4" y="5" width="12" height="11"/>
</objectgroup>
</tile>
<tile id="25">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="5" width="12" height="11"/>
</objectgroup>
</tile>
<tile id="32">
<objectgroup draworder="index" id="2">
<object id="1" x="4" y="0" width="12" height="14"/>
</objectgroup>
</tile>
<tile id="33">
<objectgroup draworder="index" id="2">
<object id="1" x="0" y="0" width="12" height="14"/>
</objectgroup>
</tile>
<wangsets>
<wangset name="Unnamed Set" type="corner" tile="-1">
<wangcolor name="gras" color="#ff0000" tile="-1" probability="1"/>