You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was going through the platformer tutorial. It's really nice, thank you!
One small issue I noticed is that when using ESC to reset it works, but there's a fraction of a second where the player is in the lower left before it jumps to the center. This is with Python 3.13 on MacOS.
Is there a way to restructure the code to avoid this "flash of mispositioned content"?
What happens here is that you get the default camera position at 0, 0 because you re-create it completely so you get one frame with default camera.. then next frame with centered camera. The is usually on_update, on_draw, process input BUT this is never guaranteed. on_draw can happen more than once per cycle depending on os, environment and all window update settings.
An even better solution is to create a smarter and more light weight reset function but that would probably look very different based on what game you are creating?
This might also be somewhat related to pyglet/pyglet#1268 since events can be skipped BUT you can also configure a custom draw an update rate so the fact still stands that on_update is always where scene changes should be done.
I was going through the platformer tutorial. It's really nice, thank you!
One small issue I noticed is that when using ESC to reset it works, but there's a fraction of a second where the player is in the lower left before it jumps to the center. This is with Python 3.13 on MacOS.
Is there a way to restructure the code to avoid this "flash of mispositioned content"?
To reproduce run this:
Here's a screen screenshot showing the incorrect positioning:
Here's a recording:
Screen.Recording.2025-01-31.at.19.56.56.mov
The text was updated successfully, but these errors were encountered: