Open mmhanson opened 3 years ago
Tested and jitter is removed, but it appears this math is quite a bit more expensive now. I had consistently >60fps prior to testing, and have seen dips to ~28fps with the update on my, truthfully, borderline antiquated hardware.
Bug Description
The blocks on screen jitter when the player walks horizontally and rotates simultaneously.
Bug Reproduction
Walk to the side and rotate the camera at the same time.
Bug Cause
The bug is caused by a lack of synchronization between the
on_mouse_update
method, which updates the player rotation, and theupdate
method, which updates the player position.Bug Fix
In the
on_mouse_update
method of theWindow
class, instead of immediately updating the player rotation, buffer the updates. Then, in theupdate
method of the same class, update the player position and player rotation at the same time.