Python Forum
Problem with Tiles and Mobs
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with Tiles and Mobs
#4
Tiled just creates a tmx file which is really an xml file. Tiled does not draw the map. It does not even define in what order to draw it. You can group objects together and then draw the group on a group by group basis. Tiled just makes it easier to create the map and see what it would look like in game as you create it. As well as creating collision points and path positions.

Pygame controls where you draw each object (in layer terms). The location is determined by the xml file Tiled output. Pygame draws it in the order you put the draw commands. For example the last one is top outermost layer that will overlap other objects. So if group A is draw, then group B. all of group B would overlap group A whenever they come to the same location.

If you dont want this you would have to redefine the groups into more groups to reorder them further. At worst case you dont put it in a group and draw it directly last if you want it over other objects. Like a player character most likely would be above objects on the group such as trees. So trees would be drawn first. Then the player. At that point the player would always be on top of the trees.

If you made a github repo without your images included i could probably take a look at your code and run it to determine what is wrong. Otherwise i have to define all the files, create bogus images, etc. and frankly I dont want to do that. Specifically i would need to see the blit method to all your images, and the order they are in (Which you do not have shown here).
Recommended Tutorials:
Reply


Messages In This Thread
Problem with Tiles and Mobs - by Piethon - Sep-24-2019, 02:32 PM
RE: Problem with Tiles and Mobs - by metulburr - Sep-24-2019, 06:42 PM
RE: Problem with Tiles and Mobs - by Piethon - Sep-25-2019, 02:32 PM
RE: Problem with Tiles and Mobs - by metulburr - Sep-25-2019, 11:36 PM
RE: Problem with Tiles and Mobs - by Piethon - Oct-04-2019, 10:29 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020