Closed drewaburden closed 10 years ago
Simply rounding the player's position when the sprite is drawn seems to have no effect.
Rounding the player's position every time it's set resolves the lagging and catching up problem, but it causes the stuttering to become really bad, as I expected.
Rounding the actual boundsUpdate variable when it's set in CameraPanner (rather than just rounding the camera position) and not rounding the player position seems to make things a little better, but it's still far from ideal. It still makes the player still lag behind the camera pan every few seconds, but the stuttering is much less noticeable.
I'm going to close this issue and update issue #2 to address the player lagging.
When the camera pans, some sprites don't seem to translate at the same rate. As with previous issues, this could very possibly be due to nonexistent sub-pixel rendering on TextureFilter.NEAREST sprites. Rounding the camera pan distance to the nearest whole number seems to fix the out of sync sprites, but it heavily exacerbates issue #2. It causes the player to still stutter as in issue #2, but then it also causes the player to look as if he's lagging behind the camera pan and then catching up and then lagging behind, and so on. It might be worth investigating rounding the player's position in addition to the camera position to try to resolve that side effect (and hopefully resolve both this issue and issue #2).