I’m making an enemy npc and when it hits a wall i want it to flip on the x axis and then move in the direction it came from. The code below currently flips the characters animation but i was wondering how i would also flip its collision boxes because i have a hitbox which i want to move to the other side of the character once it has flipped.
sprite.set_hflip("#sprite", self.movement < 0)
below is a screenshot of what the enemy looks like after it has flipped on the x axis, thew circular box is the enemies movement collision group and the rectangular box is the enemies hitbox