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:
When your character is looking rightward, his width is positive. So, all you need to do is to invert proportionally his width.
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