pygame game crashes when I edit tilesheets in tiled

79 Views Asked by At

I am trying to make a game with pygame using tiled. When I edit tilesheets (to for example add collision) I get a bunch of error messages when I run my code.

When I use the same tilesheet without editing I get no errors and all the files work.

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

Is there any way of solving this?

0

There are 0 best solutions below