Jump to content

Switching x positions of two sprites


killer_manatee
 Share

Recommended Posts

Hi all,

 

Brand new to Phaser. I'm making a katamari fan game, and so far i have the character and the ball, but I want the prince character to be on the left side of the ball when moving right and on the right side while moving left. Is there a way to tell a sprite group to be a mirror image of itself only when moving to the right? 

 

Thanks

Link to comment
Share on other sites

You could probably set the character sprite to be a child of the ball, with the appropriate offset of the default state (let's say moving to the left).  Then, when the player moves to the other state (the right) flip the x scale of the character sprite, from 1 to -1.  The character should now be facing the opposite direction on the other side of the ball.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...