Vaughan Posted April 19, 2014 Share Posted April 19, 2014 For example, if I have a sprite going to the left and it's moving to the right is the same as left, but horizontally flipped -- is there a feature to play an animation, but flipped? I could use a manual scale I guess, but it'd be nice if Phaser handled this since it's pretty common Link to comment Share on other sites More sharing options...
Heppell08 Posted April 19, 2014 Share Posted April 19, 2014 Player.scale.x *=-1;Do it for both ways though. Eg:If(Player.body.velocity.x = left){Player.scale.x *=-1;}If(player.body.velocity.x = right){Player.scale.x *=-1;} Link to comment Share on other sites More sharing options...
Heppell08 Posted April 19, 2014 Share Posted April 19, 2014 Same rules apply for vertical too. Just switchout the X for Y in scale. Link to comment Share on other sites More sharing options...
Vaughan Posted April 19, 2014 Author Share Posted April 19, 2014 I'm aware of that, I'm wondering if there's a way we can specify this somehow in Phaser though so that when we add our animations we can make this more automatic. Link to comment Share on other sites More sharing options...
Recommended Posts