We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hey there!
I'm developing a platformer for which I'm using png's to display the character in different ways. When he's moving to the right I want him facing right and when moving to the left, left. I have drawn the frames for the animation and they're all turned to the right by default.
Rather than making a corresponding flipped image for each of the frames, I would prefer to somehow flip the image in the code to make the character turn the other way. Is this possible? If so- how?
Answers
scale(-1,0);
Here's what I did.
Unfortunately, without an error message, the character just disappears, until it's no longer flipped :/
you probably need a translate as well to move it back onto the screen.
Yes! That's it. I didn't consider the fact that scale() not only inverts the size but also the position. This is what I came up with:
Thanks a lot to both of you!