我正在重构我的游戏,我想使用AltasTmxMapLoader
来提高我的TiledMaps
. 我坚持将 atlas 属性添加到地图中。例如,我需要把它放在这张地图的什么地方?
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" orientation="orthogonal" width="10" height="10" tilewidth="32" tileheight="32">
<tileset firstgid="1" name="tile2" tilewidth="32" tileheight="32">
<image source="tile2.png" width="512" height="512"/>
</tileset>
<tileset firstgid="257" name="mountain" tilewidth="32" tileheight="32">
<image source="mountain.png" width="512" height="512"/>
</tileset>
<tileset firstgid="513" name="pubdlcnt" tilewidth="32" tileheight="32">
<image source="pubdlcnt.png" width="512" height="512"/>
</tileset>
<tileset firstgid="769" name="snowWit" tilewidth="32" tileheight="32">
<image source="snowWit.png" width="512" height="512"/>
</tileset>
<tileset firstgid="1025" name="tile2" tilewidth="32" tileheight="32">
<image source="tile2.png" width="512" height="512"/>
</tileset>
<tileset firstgid="1281" name="tree+rock" tilewidth="32" tileheight="32">
<image source="tree+rock.png" width="512" height="512"/>
<tile id="129">
<properties>
<property name="blocked" value=""/>
</properties>
</tile>
<tile id="161">
<properties>
<property name="move" value=""/>
</properties>
</tile>
</tileset>
<tileset firstgid="1537" name="trees" tilewidth="32" tileheight="32">
<image source="trees.png" width="512" height="512"/>
</tileset>
<tileset firstgid="1793" name="trees2" tilewidth="32" tileheight="32">
<image source="trees2.png" width="512" height="512"/>
</tileset>
<layer name="background1" width="10" height="10">
<data encoding="base64" compression="zlib">
eJzzZ2Bg8B/FgwYDAFyQHt0=
</data>
</layer>
<layer name="background" width="10" height="10">
<data encoding="base64" compression="zlib">
eJxjYGBgmISEGfDQi5AwAx76KBSPAtxgIysEowMAMnYKLw==
</data>
</layer>
<layer name="background" width="10" height="10">
<data encoding="base64" compression="zlib">
eJybxMDAcBqIJxGgFwHxbSJoUsA1IL6OR/4XlD4KxSMBAAA87BJ0
</data>
</layer>
<layer name="foreground1" width="10" height="10">
<data encoding="base64" compression="zlib">
eJxjYCAOzCdCzTwofQyIj+NR94pIO0m1l5pgoOwFACVaBi8=
</data>
</layer>
<layer name="blocked" width="10" height="10">
<data encoding="base64" compression="zlib">
eJxrYmVgaKIiJgUQ0kOqeUMJLGKFYHQAAKpXDXA=
</data>
</layer>
</map>
我已经尝试过将它添加到地图标签和tileset标签中,但这不是正确的解决方案。我已经注意到,我需要将地图集与 tmx 文件放在同一个文件夹中,但我真的想知道将标签放在哪里。
Exception in thread "main" java.lang.NoClassDefFoundError: com/badlogic/gdx/util
s/GdxRuntimeException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
at java.lang.Class.getMethod0(Class.java:2774)
at java.lang.Class.getMethod(Class.java:1663)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486)
Caused by: java.lang.ClassNotFoundException: com.badlogic.gdx.utils.GdxRuntimeEx
ception
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 6 more