Disease Posted June 11, 2016 Share Posted June 11, 2016 I'm using Phaser 2.4.8 and seem to be having a strange issue. In the player sprite constructor I set the anchor to .5, .5 this.anchor.setTo(.5, .5); The spritesheet is drawn with the character facing right, so when the player presses LEFT this is what I do to point it left: if (this.game.input.keyboard.isDown(Phaser.Keyboard.LEFT)) { if (this.scale.x == 1) { this.scale.x = -1; } } Unfortunately this simple act causes the Sprite's physics body to leap to the sprite/sprite texture's right side for no reason I can see. The image of the character moves around fine but the physics body jumps around every time the scale switches between 1 and -1. You can see this happening with all the debugging information turned on at: http://syntonicstudios.github.io/Shapeshifter/bin/index.html Also the entire source of the game is at: https://github.com/SyntonicStudios/Shapeshifter I thought I was missing something simple until I looked at an old game I did wish Phaser were I did the exact same thing but this issue did not crop up at all. Anyone know what is going on here? Link to comment Share on other sites More sharing options...
LTNGames Posted June 11, 2016 Share Posted June 11, 2016 This is fixed in the newest Dev build of Phaser, this and many other updates have been added. You can check the offical thread here Link to comment Share on other sites More sharing options...
Disease Posted June 11, 2016 Author Share Posted June 11, 2016 5 minutes ago, LTNGames said: Alright, thanks for the quick reply. I must have a bad case of Imposter Syndrome because I was staring intently at my code for like two hours trying to figure out where I messed up. Link to comment Share on other sites More sharing options...
LTNGames Posted June 11, 2016 Share Posted June 11, 2016 No problem, I went through the same thing, I spent a good hour thinking I was not doing things correctly then found out it was a bug. Glad I was able to help before you pulled out your hair lol. Link to comment Share on other sites More sharing options...
Recommended Posts