当我在图块中编辑图块时,pygame游戏崩溃

时间:2019-01-17 15:24:25

标签: pygame tiled

我正在尝试使用平铺的pygame制作游戏。当我编辑磁贴纸时(例如添加碰撞),运行代码时会收到一堆错误消息。

当我使用相同的图块而不进行编辑时,不会出现任何错误,所有文件都可以正常工作。

Traceback (most recent call last):
       File "C:/Users/47988/PycharmProjects/Terrible/Main.py", line 94, in 
<module>
    g = Game()
  File "C:/Users/47988/PycharmProjects/Terrible/Main.py", line 16, in init
  self.load_data()
    File "C:/Users/47988/PycharmProjects/Terrible/Main.py", line 22, in load_data
      self.map = TiledMap(path.join(map_folder, "map6.tmx"))
    File "C:\Users\47988\PycharmProjects\Terrible\Tilemap.py", line 21, in init
      tm = pytmx.load_pygame(filename, pixelalpha=True)
    File "C:\Users\47988\PycharmProjects\Terrible\venv\lib\site-            packages\pytmx\util_pygame.py", line 141, in load_pygame
      return pytmx.TiledMap(filename, *args, **kwargs)
    File "C:\Users\47988\PycharmProjects\Terrible\venv\lib\site-packages\pytmx\pytmx.py", line 360, in init
      self.parse_xml(ElementTree.parse(self.filename).getroot())
    File "C:\Users\47988\PycharmProjects\Terrible\venv\lib\site-      packages\pytmx\pytmx.py", line 400, in parse_xml
      self.add_tileset(TiledTileset(self, subnode))
    File "C:\Users\47988\PycharmProjects\Terrible\venv\lib\site-packages\pytmx\pytmx.py", line 845, in init
      self.parse_xml(node)
    File "C:\Users\47988\PycharmProjects\Terrible\venv\lib\site-packages\pytmx\pytmx.py", line 874, in parse_xml
      raise Exception
  Exception

有什么办法解决这个问题?

0 个答案:

没有答案