debug advanced, new map part (INN)

master
GammelJAN 5 years ago
parent 4bef651d49
commit d6c92dc6e6

@ -0,0 +1,2 @@
Hier kann man später schlafen
...#-1

@ -0,0 +1,2 @@
Hier kann man später schlafen
...#-1

@ -0,0 +1,3 @@
Ich bin der Besitzer dieses Inns! Möchtest du hier schlafen?
Ja, gerne!#-1
Nein, gerade nicht.#-1

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.4" tiledversion="1.4.3" orientation="orthogonal" renderorder="right-down" width="40" height="50" tilewidth="32" tileheight="32" infinite="0" nextlayerid="11" nextobjectid="116">
<map version="1.4" tiledversion="1.4.3" orientation="orthogonal" renderorder="right-down" width="40" height="50" tilewidth="32" tileheight="32" infinite="0" nextlayerid="11" nextobjectid="117">
<tileset firstgid="1" source="../tilesets/terrain.tsx"/>
<tileset firstgid="2049" source="../tilesets/village.tsx"/>
<tileset firstgid="3849" source="../tilesets/crops.tsx"/>
@ -125,7 +125,7 @@
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3037,3038,3037,3038,3037,3038,3962,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,6300,6301,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3962,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,6316,6317,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3803,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,7032,0,0,0,0,0,0,0,0,0,0,0,6451,6454,0,6487,0,0,3962,0,0,0,3962,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,7032,0,0,0,0,0,7437,0,0,0,0,0,6451,6454,0,6487,0,0,3962,0,0,0,3962,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2195,2196,6467,6470,6520,6503,2255,0,0,3803,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2077,2078,2256,2137,0,0,2078,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2256,2138,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@ -278,7 +278,7 @@
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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="6" name="CollisionRects">
<objectgroup id="6" name="CollisionRects" visible="0">
<object id="1" x="0" y="1344" width="160" height="64"/>
<object id="2" x="160" y="1376" width="32" height="32"/>
<object id="3" x="0" y="1408" width="32" height="192"/>
@ -365,7 +365,7 @@
<object id="113" x="1056" y="992" width="224" height="32"/>
<object id="114" x="1088" y="1024" width="192" height="576"/>
</objectgroup>
<objectgroup id="7" name="DoorRects">
<objectgroup id="7" name="DoorRects" visible="0">
<object id="88" x="150.875" y="191.75" width="52.625" height="43.625">
<properties>
<property name="destinationDoor" type="int" value="0"/>
@ -418,8 +418,14 @@
<property name="texture" value="-"/>
</properties>
</object>
<object id="116" x="640" y="224" width="32" height="32">
<properties>
<property name="id" type="int" value="3"/>
<property name="texture" value="-"/>
</properties>
</object>
</objectgroup>
<objectgroup id="9" name="NpcRects">
<objectgroup id="9" name="NpcRects" visible="0">
<object id="98" x="896" y="288" width="64" height="64">
<properties>
<property name="id" type="int" value="0"/>
@ -433,7 +439,7 @@
</properties>
</object>
</objectgroup>
<objectgroup id="10" name="EnemyRects">
<objectgroup id="10" name="EnemyRects" visible="0">
<object id="115" x="736" y="1216" width="160" height="96">
<properties>
<property name="atk" type="int" value="2"/>

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.4" tiledversion="1.4.3" orientation="orthogonal" renderorder="right-down" width="12" height="10" tilewidth="32" tileheight="32" infinite="0" nextlayerid="11" nextobjectid="20">
<map version="1.4" tiledversion="1.4.3" orientation="orthogonal" renderorder="right-down" width="12" height="10" tilewidth="32" tileheight="32" infinite="0" nextlayerid="11" nextobjectid="22">
<tileset firstgid="1" source="../tilesets/village.tsx"/>
<tileset firstgid="1801" source="../tilesets/worldborder.tsx"/>
<tileset firstgid="1809" source="../tilesets/furniture.tsx"/>
<tileset firstgid="1821" source="../tilesets/furniture.tsx"/>
<layer id="1" name="under0" width="12" height="10">
<data encoding="csv">
1803,1801,1801,1801,1801,1801,1801,1801,1801,983,0,1804,
0,0,0,0,0,0,0,0,0,0,0,0,
983,983,983,983,983,983,983,983,983,983,983,983,
983,983,983,983,983,983,983,983,983,983,983,983,
983,983,983,983,983,983,983,983,983,983,983,983,
@ -19,8 +19,8 @@
</layer>
<layer id="3" name="under1" width="12" height="10">
<data encoding="csv">
0,1830,1831,1832,1833,1834,0,0,0,0,0,0,
0,1862,1863,1864,1865,1866,0,0,0,0,0,0,
2824,2824,2824,2824,2824,2824,2824,2824,2824,2824,2824,2824,
2856,2856,2856,2856,2856,2856,2856,2856,2856,2856,2856,2856,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
@ -33,44 +33,44 @@
</layer>
<layer id="4" name="under2" width="12" height="10">
<data encoding="csv">
0,2501,0,0,0,0,0,2531,2532,0,0,0,
0,0,0,0,0,0,0,2563,2564,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,1996,1996,0,
0,1843,1844,1845,1846,0,0,0,0,0,0,1848,
0,1875,1876,1877,1878,0,0,0,0,0,0,1976,
0,0,0,0,0,0,0,0,0,2008,2008,2008,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,2021,2022,2023,0,0,0,0,0,0,0,
0,0,2053,2054,2055,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,2691,2692,2693,0,
0,0,0,0,0,0,0,0,2723,2724,2725,0,
0,0,2033,2034,2035,0,0,0,0,0,0,0,
0,0,2065,2066,2067,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,2703,2704,2705,0,
0,0,0,0,0,0,0,0,2735,2736,2737,0,
0,0,0,0,0,0,0,0,0,0,0,0
</data>
</layer>
<layer id="5" name="above0" width="12" height="10">
<data encoding="csv">
0,0,0,0,0,0,0,0,0,1801,1801,0,
1805,0,0,0,0,0,0,0,0,1837,1869,1802,
1805,0,0,0,0,0,0,0,0,1964,1964,1802,
1805,0,0,0,0,0,0,0,0,0,0,1802,
1805,0,1989,2317,1991,0,0,0,0,0,0,0,
1805,0,0,0,0,0,0,0,0,0,0,0,
1805,0,0,0,0,0,0,0,2659,2660,2661,1802,
1805,0,0,0,0,0,0,0,0,0,0,1802,
1805,0,0,0,0,0,0,0,0,0,0,1802,
1807,1806,1806,1806,1806,0,0,1806,1806,1806,1806,1808
</data>
</layer>
<layer id="6" name="above1" width="12" height="10" visible="0">
<data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,1849,1881,0,
0,0,0,0,0,0,0,0,0,1976,1976,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,2001,2329,2003,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,1990,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,2671,2672,2673,0,
0,0,0,0,0,0,0,0,0,0,0,0,
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>
<layer id="6" name="above1" width="12" height="10">
<data encoding="csv">
1814,1806,1806,1806,1806,1806,1806,1806,1806,1806,1806,1813,
1802,0,0,0,0,0,0,0,0,0,0,1805,
1802,0,0,0,0,0,0,0,0,0,0,1805,
1802,0,0,0,0,0,0,0,0,0,0,1817,
1802,0,0,2002,0,0,0,0,0,0,0,0,
1802,0,0,0,0,0,0,0,0,0,0,0,
1802,0,0,0,0,0,0,0,0,0,0,1819,
1802,0,0,0,0,0,0,0,0,0,0,1805,
1802,0,0,0,0,0,0,0,0,0,0,1805,
1810,1801,1801,1801,1811,0,0,1812,1801,1801,1801,1809
</data>
</layer>
<objectgroup id="2" name="CollisionRects">
@ -78,15 +78,14 @@
<object id="3" x="96.5" y="140.5" width="31" height="18"/>
<object id="4" x="293" y="257" width="24" height="16"/>
<object id="5" x="276" y="224.5" width="58" height="31"/>
<object id="6" x="288.5" y="97.5" width="62" height="26"/>
<object id="7" x="224" y="0" width="64" height="64"/>
<object id="8" x="32" y="19.5" width="160" height="32"/>
<object id="6" x="288.5" y="97.5" width="86.5" height="26"/>
<object id="9" x="0" y="0" width="12.5" height="320"/>
<object id="10" x="12.5" y="312" width="147.5" height="8.5"/>
<object id="11" x="224" y="311" width="160" height="9"/>
<object id="12" x="371.5" y="193" width="12.5" height="118"/>
<object id="13" x="376" y="0.5" width="8" height="127.5"/>
<object id="14" x="12.5" y="1" width="363.5" height="7"/>
<object id="14" x="12.5" y="1" width="363.5" height="47.5"/>
<object id="20" x="31" y="49" width="128.5" height="34"/>
</objectgroup>
<objectgroup id="7" name="DoorRects">
<object id="16" x="160" y="311.5" width="64" height="9">
@ -115,7 +114,7 @@
</object>
</objectgroup>
<objectgroup id="9" name="NpcRects">
<object id="19" x="32" y="64" width="160" height="64">
<object id="19" x="31.5" y="88" width="171" height="37.5">
<properties>
<property name="id" type="int" value="0"/>
<property name="texture" value="sprite.png"/>

@ -0,0 +1,129 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.4" tiledversion="1.4.3" orientation="orthogonal" renderorder="right-down" width="20" height="10" tilewidth="32" tileheight="32" infinite="0" nextlayerid="13" nextobjectid="33">
<tileset firstgid="1" source="../tilesets/village.tsx"/>
<tileset firstgid="1801" source="../tilesets/worldborder.tsx"/>
<tileset firstgid="1821" source="../tilesets/furniture.tsx"/>
<tileset firstgid="3229" source="../tilesets/container.tsx"/>
<layer id="3" name="under0" width="20" height="10">
<data encoding="csv">
983,983,983,983,983,983,983,983,983,983,983,0,0,983,983,983,983,983,983,983,
983,983,983,983,983,983,983,983,983,983,983,0,983,983,983,983,983,983,983,983,
983,983,983,983,983,983,983,983,983,983,983,0,983,983,983,983,983,983,983,983,
983,983,983,983,983,983,983,983,983,983,983,0,983,983,983,983,983,983,983,983,
983,983,983,983,983,983,983,983,983,983,983,0,983,983,2827,2827,2827,2827,983,983,
983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,
983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,
983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,
983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,
983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983,983
</data>
</layer>
<layer id="4" name="under1" width="20" height="10">
<data encoding="csv">
2824,2824,2824,2824,2824,2824,2824,2824,2824,2824,2824,0,2824,2824,2824,2827,2827,2824,2824,2824,
2856,2856,2856,2856,2856,2856,2856,2856,2856,2856,2856,0,2856,2856,2856,2827,2827,2856,2856,2856,
0,0,0,0,0,0,0,0,0,0,0,2827,0,0,0,2827,2827,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2827,2827,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,1806,1808,1807,1806,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,2825,2824,2824,2888,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,2857,2856,2856,2920,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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>
<layer id="5" name="under2" width="20" height="10">
<data encoding="csv">
0,0,0,0,0,0,0,3788,0,0,2827,2827,2454,2455,2456,1820,1819,2454,2455,2456,
0,0,0,0,0,1904,0,3804,0,0,2827,2827,2486,2487,2488,1802,1805,2486,2487,2488,
0,0,0,0,0,1901,0,0,0,0,2827,0,2518,2519,2520,1802,1805,2518,2519,2520,
0,0,0,0,0,1901,0,0,0,0,2827,2827,0,0,0,1802,1805,0,0,0,
0,0,0,0,0,1901,2362,0,0,0,2827,2827,0,0,1814,0,0,1813,0,0,
0,0,0,0,0,1933,1838,1841,1999,1840,2825,2888,0,0,0,2677,2678,2679,0,0,
0,0,0,0,0,1872,1874,1873,0,1874,2857,2920,0,0,0,2709,2710,2711,0,0,
2637,2638,2639,0,0,0,0,0,0,0,0,0,0,0,0,2741,2742,2743,0,0,
2072,2072,2073,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
2640,2641,2642,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
</data>
</layer>
<layer id="6" name="above0" width="20" height="10">
<data encoding="csv">
0,0,0,0,0,0,0,0,0,0,1820,1819,1806,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,1802,1805,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,1802,1805,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,1802,1805,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,1810,1809,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,1816,1806,2513,1815,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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>
<layer id="7" name="above1" width="20" height="10">
<data encoding="csv">
1814,1806,1806,1806,1806,1806,1806,1806,1806,1806,0,0,0,1806,1806,0,0,1806,1806,1813,
1802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1805,
1802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1805,
1818,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1805,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1805,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1806,0,0,1805,
1820,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1805,
1802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1805,
1802,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1805,
1810,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1801,1809
</data>
</layer>
<objectgroup id="8" name="CollisionRects">
<object id="1" x="0" y="0" width="640" height="51"/>
<object id="5" x="320" y="50" width="320.5" height="47"/>
<object id="6" x="480" y="96" width="64" height="32"/>
<object id="7" x="453.667" y="128" width="118.333" height="81.5"/>
<object id="8" x="487" y="208.5" width="80.5" height="44"/>
<object id="10" x="319" y="97" width="63.5" height="114"/>
<object id="12" x="165.5" y="51" width="24.5" height="121.5"/>
<object id="13" x="192" y="128" width="32" height="32"/>
<object id="15" x="228" y="35.5" width="24.5" height="25"/>
<object id="16" x="0" y="224" width="96" height="96"/>
<object id="17" x="-1" y="191.5" width="8.5" height="31"/>
<object id="18" x="0" y="50" width="8" height="78"/>
<object id="19" x="95.3333" y="312.667" width="544.667" height="7.33333"/>
<object id="20" x="633.333" y="97.3333" width="6.66667" height="215.333"/>
<object id="22" x="165.333" y="172.667" width="88.6667" height="43"/>
<object id="23" x="253.667" y="172.333" width="34.3333" height="19"/>
<object id="24" x="287.667" y="171.667" width="31" height="40.3333"/>
</objectgroup>
<objectgroup id="9" name="DoorRects">
<object id="26" x="0" y="127.667" width="3.33333" height="64.3333">
<properties>
<property name="destinationDoor" type="int" value="1"/>
<property name="destinationMap" type="int" value="2"/>
<property name="exit" type="int" value="3"/>
<property name="id" type="int" value="0"/>
</properties>
</object>
</objectgroup>
<objectgroup id="10" name="InteractionRects">
<object id="30" x="394" y="8.5" width="76" height="87.5">
<properties>
<property name="id" type="int" value="1"/>
<property name="texture" value="-"/>
</properties>
</object>
<object id="31" x="553.5" y="7.5" width="77" height="89">
<properties>
<property name="id" type="int" value="2"/>
<property name="texture" value="-"/>
</properties>
</object>
</objectgroup>
<objectgroup id="11" name="NpcRects">
<object id="32" x="207" y="90.5" width="21.5" height="20.5">
<properties>
<property name="id" type="int" value="0"/>
<property name="texture" value="sprite.png"/>
</properties>
</object>
</objectgroup>
<objectgroup id="12" name="EnemyRects"/>
</map>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1003 B

After

Width:  |  Height:  |  Size: 1.5 KiB

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<tileset version="1.4" tiledversion="1.4.3" name="worldborder" tilewidth="32" tileheight="32" tilecount="8" columns="4">
<image source="../pngs/worldBorder.png" width="128" height="64"/>
<tileset version="1.4" tiledversion="1.4.3" name="worldborder" tilewidth="32" tileheight="32" tilecount="16" columns="4">
<image source="../pngs/worldBorder.png" width="128" height="128"/>
</tileset>

@ -5,6 +5,7 @@ import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Input;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.trs.main.view.UI.DebugUI;
import com.trs.main.view.screens.GameScreen;
import com.trs.main.view.screens.InventoryScreen;
import com.trs.main.view.screens.MenuScreen;
@ -28,6 +29,7 @@ public class Main extends Game{
MenuScreen menuScreen;
GameScreen gameScreen;
InventoryScreen inventoryScreen;

@ -18,13 +18,13 @@ public abstract class FightObject {
private int state = 0;
public FightObject(float x, float y, AnimatedSprite sprite, Stats stats, int id) {
this.sprite = sprite;
this.stats = stats;
this.id = id;
this.x = x;
this.y = y;
maxMoves = 2;
moves = maxMoves;
this.sprite = sprite;
this.stats = stats;
this.id = id;
this.x = x;
this.y = y;
maxMoves = 2;
moves = maxMoves;
}
void setX(float x) {

@ -41,9 +41,9 @@ public class FightScreen {
gridPos.y = (float)(Math.ceil((double)(camY-Main.CAMERA_HEIGHT/2)/32.0) * 32.0) + 32;
// SORTING OBJECTS BY INITIATIVE STAT
// SORTING OBJECTS BY INITIATIVE STAT
for(int j = 0; j < objects.length-1; j++){
for(int j = 0; j < objects.length-1; j++){
for(int i = objects.length-1; i >= 0; i--){
if(i > 0 && objects[i].getStats().getInit() > objects[i-1].getStats().getInit()){
FightObject temp = objects[i-1];

@ -0,0 +1,91 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.trs.main.view.UI;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.GlyphLayout;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.trs.main.Main;
import java.util.ArrayList;
/**
*
* @author janeh
*/
public class DebugUI {
private BitmapFont font;
private ShapeRenderer shapeRenderer = new ShapeRenderer();
Batch batch = new SpriteBatch();
public DebugUI() {
FreeTypeFontGenerator generator = new FreeTypeFontGenerator(Gdx.files.internal("fontData/font.ttf"));
FreeTypeFontGenerator.FreeTypeFontParameter parameter = new FreeTypeFontGenerator.FreeTypeFontParameter();
parameter.size = 21;
font = generator.generateFont(parameter);
generator.dispose();
font.setColor(Color.BLACK);
}
public void draw(int entityAmount){
float textHeight = getTextHeight(font, "A")+5;
ArrayList<String> strings = new ArrayList<>();
strings.add("DeltaTime: "+Gdx.graphics.getDeltaTime());
strings.add("FPS: "+(int)(1/Gdx.graphics.getDeltaTime()));
strings.add("Actors: "+entityAmount);
float width = 0;
for(String s : strings){
float textWidth = getTextWidth(font, s);
if(textWidth > width){
width = textWidth;
}
}
Gdx.gl.glEnable(GL20.GL_BLEND);
Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
shapeRenderer.begin(ShapeRenderer.ShapeType.Filled);
shapeRenderer.setColor(0.1f, 0.1f, 0.1f, 0.8f);
shapeRenderer.rect(5, Gdx.graphics.getHeight() - (strings.size()+1)*textHeight-5, width+10,(strings.size()+1)*textHeight);
shapeRenderer.end();
Gdx.gl.glDisable(GL20.GL_BLEND);
batch.begin();
// DRAW FRAMETIME
font.setColor(Color.RED);
for(int i = 1; i < strings.size()+1; i++){
font.draw(batch, strings.get(i-1), 10,Gdx.graphics.getHeight()-textHeight*i);
}
batch.end();
}
public float getTextWidth(BitmapFont font, String text){
GlyphLayout glyphLayout = new GlyphLayout();
glyphLayout.setText(font,text);
return glyphLayout.width;
}
public float getTextHeight(BitmapFont font,String text){
GlyphLayout glyphLayout = new GlyphLayout();
glyphLayout.setText(font,text);
return glyphLayout.height;
}
}

@ -14,6 +14,7 @@ import com.trs.main.Main;
import com.trs.main.MapContainer;
import com.trs.main.Quest;
import com.trs.main.fightscreen.FightDialogue;
import com.trs.main.view.UI.DebugUI;
import com.trs.main.view.UI.QuestWindow;
import com.trs.main.view.UI.Textbox;
import com.trs.main.worldobjects.Player;
@ -26,6 +27,7 @@ public class GameScreen extends AbstractScreen{
MapContainer map;
QuestWindow qw;
DebugUI debugUI = new DebugUI();
public GameScreen(Game game, float CAMERA_WIDTH, float CAMERA_HEIGHT) {
super(game, CAMERA_WIDTH, CAMERA_HEIGHT);
@ -76,6 +78,7 @@ public class GameScreen extends AbstractScreen{
if(Gdx.input.isKeyPressed(Input.Keys.DOWN)){
map.getStage().getCamera().translate(0, -10, 0);
}
debugUI.draw(map.getStage().getActors().size);
}
else{
Player a = map.getPlayer();

@ -203,19 +203,35 @@ public class Hostile extends Actor {
shapeRenderer.circle(POI.x, POI.y, 5);
}
shapeRenderer.end();
shapeRenderer.begin(ShapeRenderer.ShapeType.Line);
shapeRenderer.setColor(Color.GREEN);
shapeRenderer.line(getX()+ sprite.getSprite().getWidth()/2, getY()+sprite.getSprite().getHeight()/2, POI.x, POI.y);
shapeRenderer.setColor(Color.ORANGE);
shapeRenderer.line(getCenterX(), getCenterY(), POI.x, POI.y);
shapeRenderer.setColor(Color.YELLOW);
shapeRenderer.circle(getX()+ sprite.getSprite().getWidth()/2, getY()+sprite.getSprite().getHeight()/2, getAttentionCircle().radius);
shapeRenderer.circle(getCenterX(), getCenterY(), getAttentionCircle().radius);
shapeRenderer.setColor(Color.RED);
shapeRenderer.circle(getX()+ sprite.getSprite().getWidth()/2, getY()+sprite.getSprite().getHeight()/2, getAttackCircle().radius);
shapeRenderer.setColor(Color.WHITE);
shapeRenderer.circle(getCenterX(), getCenterY(), getAttackCircle().radius);
shapeRenderer.rect(getX(), getY(), sprite.getSprite().getWidth(), sprite.getSprite().getHeight());
shapeRenderer.setColor(Color.WHITE);
shapeRenderer.rect(area.x, area.y, area.width, area.height);
shapeRenderer.setColor(Color.GREEN);
shapeRenderer.line(getCenterX(), getCenterY(), area.x, area.y);
shapeRenderer.line(getCenterX(), getCenterY(), area.x, area.y + area.height);
shapeRenderer.line(getCenterX(), getCenterY(), area.x + area.width, area.y);
shapeRenderer.line(getCenterX(), getCenterY(), area.x + area.width, area.y+area.height);
shapeRenderer.end();
batch.begin();
}
public float getCenterX(){
return getX()+ sprite.getSprite().getWidth()/2;
}
public float getCenterY(){
return getY()+sprite.getSprite().getHeight()/2;
}
@Override
protected void positionChanged() {

@ -88,6 +88,8 @@ public class InteractionObject extends Actor{
if(newDialogue == null) {
currentlyTalking = false;
parser = new DialogueParser(dialoguePath);
Dialogue nextDialogue = parser.firstDialogue();
this.t = new Textbox(nextDialogue.question, nextDialogue.ans);
}
else {
((Textbox)a).update(newDialogue);

@ -126,6 +126,8 @@ public class MovingNpc extends Actor{
if(newDialogue == null) {
currentlyTalking = false;
parser = new DialogueParser(dialoguePath);
Dialogue nextDialogue = parser.firstDialogue();
this.t = new Textbox(nextDialogue.question, nextDialogue.ans);
}
else {
((Textbox)a).update(newDialogue);
@ -265,16 +267,33 @@ public class MovingNpc extends Actor{
shapeRenderer.end();
shapeRenderer.begin(ShapeRenderer.ShapeType.Line);
if(POI != null){
shapeRenderer.setColor(Color.GREEN);
shapeRenderer.line(getX()+ animatedSprite.getSprite().getWidth()/2, getY()+animatedSprite.getSprite().getHeight()/2, POI.x, POI.y);
shapeRenderer.setColor(Color.ORANGE);
shapeRenderer.line(getCenterX(), getCenterY(), POI.x, POI.y);
}
shapeRenderer.setColor(Color.WHITE);
shapeRenderer.rect(getX(), getY(), animatedSprite.getSprite().getWidth(), animatedSprite.getSprite().getHeight());
shapeRenderer.setColor(Color.WHITE);
shapeRenderer.rect(area.x, area.y, area.width, area.height);
shapeRenderer.setColor(Color.GREEN);
shapeRenderer.line(getCenterX(), getCenterY(), area.x, area.y);
shapeRenderer.line(getCenterX(), getCenterY(), area.x, area.y + area.height);
shapeRenderer.line(getCenterX(), getCenterY(), area.x + area.width, area.y);
shapeRenderer.line(getCenterX(), getCenterY(), area.x + area.width, area.y+area.height);
shapeRenderer.end();
batch.begin();
}
public float getCenterX(){
return getX()+ animatedSprite.getSprite().getWidth()/2;
}
public float getCenterY(){
return getY()+animatedSprite.getSprite().getHeight()/2;
}
public boolean collidingWithMapCollisionObject(){
for(Actor a : getStage().getActors()){
if(a instanceof MapCollisionObject){

Loading…
Cancel
Save