What is the best way to manage flipping a character from left to right and so on? For example, you have a character with a collision shape, sprite, and area2d with collision shape to detect sword swings. How would you approach flipping this character to the left side and back to the right? I find that doing each separate node and flipping it with
node.position.x = direction * HARDCODED DISTANCE
The hardcoded distance part is what disturbs me, when I have a area2D that is positioned like 2 on the x and 0 on y, to flip it I have to hard code direction * 2 to always keep it the same distance. How do you handle flipping nodes and flipping all of the hit boxes areas and everything to flip with it? Anyway to avoid hardcoding values?
2D, 2 directions, left and right
https://imgur.com/a/VF37Mdo