Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyGame] i need help pls
#3
The problem is in the sequence.

1. Update everything
2. collision x - stops player from colliding with anything in X direction
3. collision y - stops player from colliding with anything in Y direction
4. Check for collisions between player and tiles. Guaranteed there are no collisions.

I also find it odd you put the treasure in the same group as the other tiles (walls and floors). How are you supposed to know that a collision is with treasure? This does not only check for Mesa objects.
for Mesa in self.tiles.sprites():
The Mesa name is meaningles in this conext. It is just a variable and works the same if it is "a" instead of Mesa. The loop looks at all sprites. in the tiles group, not just sprites that are Mesa objects..
Reply


Messages In This Thread
i need help pls - by augusto_A - May-28-2023, 01:44 PM
RE: i need help pls - by menator01 - May-28-2023, 05:36 PM
RE: i need help pls - by deanhystad - May-30-2023, 04:48 PM

Forum Jump:

User Panel Messages

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