# How player(sprite) in the phaser will opposite or reverse while going left and right?

I am developing a game where my player has to look to see forward when I am pressing right arrow key. But how can I make it look reverse after pressing left arrow? I can create a sprite of reverse look but how can load that while pressing left and at the same time forward player should be destroyed?

Usually I set the sprite's scale.x to -1 to flip it horizontally. You can see an example here: https://phaser.io/examples/v2/sprites/scale-a-sprite some of those sprites are scaled to negative values, and they appear mirrored.

Another approach is to flip the sprites in your assets. This has the added advantage of looking correct if the character is handed - if they were holding a gun, they won't be switching their gun hand depending on which direction they're facing. Phaser's platformer example does this, and has separate left and right animation frames:

• I ran into some weird issues with setting X to -1. I just mirrored my image to create "left-walk" animation. thanks. – BatteryAcid Aug 21 '18 at 21:56

When your character is looking rightward, his width is positive. So, all you need to do is to invert proportionally his width.

Visual example:

This image's width is 779px

And this image's width is -779px

When reversing, also remember to add the X-axis by the width, so that the character's sprite doesn't "walk" behind the total units that the width of the sprite has