Nov-12-2019, 07:09 PM
For debugging print the values you are comparing and look at the values that are printed when player hits a wall.
def collide_with_walls(self, dx=0, dy=0): for wall in walls: print(wall.rect.x, self.rect.x+dx, wall.rect.y, self.rect.y+dy) if wall.rect.x==self.rect.x + dx and wall.rect.y == self.rect.y + dy: return True return False