Skip to content

Fix oscillating paddle at low framerates - #4

Merged
toji merged 1 commit into
toji:mainfrom
jschwe:low_framerate_paddle
Jun 9, 2026
Merged

toji merged 1 commit into
toji:mainfrom
jschwe:low_framerate_paddle

Conversation

@jschwe

@jschwe jschwe commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

While testing this on a less powerful mobile device, I observed an annoying flickering of the paddle after starting the game, even if no further input was given.
It seems that at low framerates (~20 fps in my case), the previous code can cause wild oscillations of the paddle.
Clamping the movement to the remaining delta prevents overshooting.
(I'm working on getting this game to run in servo, so performance not being great is not that unexpected.)

While testing this on a less powerful mobile device,
I observed an annoying flickering of the paddle after starting the
game, even if no further input was given.
It seems that at low framerates (~20 fps in my case), the previous
code can cause wild oscillations of the paddle.
Clamping the movement to the remaining delta prevents overshooting.

@toji toji left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, thanks! I've seen this before on occasion and simply have never remembered to come back and try to figure it out. I appreciate the fix!

@toji
toji merged commit cd816b2 into toji:main Jun 9, 2026
@jschwe
jschwe deleted the low_framerate_paddle branch June 9, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants