mccxiv Posted May 21, 2016 Share Posted May 21, 2016 Hi friends, any idea why the sprite seems to jump around as soon as the camera begins moving? It happens with both `game.camera.follow(player);` and the smooth camera you see in the demo. And also happens with both `game.renderer.renderSession.roundPixels` set to true and false... It's not a CPU/GPU issue as far as I can tell, the rest of the game is running smoothly. Movement code: function moveToNextTile() { if (isDead()) return; state.moving = true; faceNextTile(); setWalkingAnimation(); const {x, y} = World.instance.toPixel(nextTile()); const tween = Game.instance.add.tween(state.sprite); tween.to({x, y}, 400); tween.onComplete.addOnce(onNewTile); tween.start(); } Upperfoot 1 Link to comment Share on other sites More sharing options...
Upperfoot Posted May 25, 2016 Share Posted May 25, 2016 I get this as well on the latest version of v2.4.8, tweening while the camera is moving produces a Jumpy tween even with the tween set as Linear.None the movement code I'm using is http://jsfiddle.net/mub2ps0c/7/ Link to comment Share on other sites More sharing options...
drhayes Posted May 27, 2016 Share Posted May 27, 2016 Upperfoot, I think what you're seeing is the frame or two in between successive tweens. Like, tween 1 is running, then a frame or two, then tween 2 picks up. I'm seeing the sprite jump with no camera movement, and changing all those values to 23 or 92 produce jumps at 23 or 92 pixels. Link to comment Share on other sites More sharing options...
eddieone Posted May 27, 2016 Share Posted May 27, 2016 Browserquest! You might test with movement done manually by setting x and y in a the update function. Also test your frame rates too! game.time.advancedTiming = true; game.debug.text(game.time.fps, 2, 14, "#00ff00"); Link to comment Share on other sites More sharing options...
Upperfoot Posted May 28, 2016 Share Posted May 28, 2016 Thanks guys but it seems the issue only presents itself when the camera follows the sprite while it's tweening, if the camera has a dead zone there is no jerky movement as the camera isn't moving while the sprite is tweening, but as soon as it's outside the dead zone the jerky movement starts, if you look at the above gif by mccxiv you can see this happening clear as day. My FPS is a solid 60 and has advanced timing enabled, tried with round pixels being enabled and many other configurations. There is a github issue on the matter. https://github.com/photonstorm/phaser/issues/2482 Link to comment Share on other sites More sharing options...
Recommended Posts