So I’m making a game in javascript canvas. I’m using the context.scale(-1, 1)
function, called within a method of my Sprite class that updates the image every frame to draw the mirrored image. I’m setting the scale back to (1,1) when I draw the non-flipped sprite. The problem is, the spirite that’s supposed to be flipped is not getting mirrored and it’s constantly flashing, any ideas?
I tried using save()
and restore()
methods of the context object. Not succesful, same result.