Hi. I’ve the following problem:
I’ve a character that when is idle, let’s say… it’s 90 px wide, but when the punching animation occurs, it increases to 120 px.
How do you deal with different sprite sizes on position, rendering and boundries? Because if I do the following:
You can see that when the character is idle it is the same width that when it’s punching and this leads to improper collision detection.
My only guess is to offset all frames x - (width / 2) in the rendering code.
Originally, this images where not all the same size… I made them with Photoshop to be the same size to make it easy for me to render, but the sprites where all with varying sizes, like this:
And the problem with that is that all animations where off-center from each other and the character width was dependent on the frame size and I just couln’t properly sinchronize all frames through math alone. I could’ve put an offset for every frame manually, but I find this cumbersome.
How do you usually deal with this?
Am I in the right path?