Skip to content

Conversation

rossleonardy
Copy link

Objective

Addresses #14239
Move breakout example to use virtual time instead of fixed time updates

Solution

  • The example already used time.delta().as_secs() so it wasn't very dependent on fixed time; comments on the issue suggested using StableInterpolate so I did
  • I changed the paddle entity to also use a velocity to be more similar to the ball and moved its clamping behavior to a separate system (This could possibly be treated as a collision and handled in check_for_collisions? )

Testing

  • I tested the example before and after the changes and verified the same behavior on a macbook m2 pro. I did not test it on other platforms.
  • The changes can be tested with
cargo run --example breakout

Showcase

Visually identical to the existing breakout example
Screenshot 2025-08-20 at 9 10 39 PM

Copy link
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

@ickshonpe ickshonpe added C-Examples An addition or correction to our examples D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward X-Uncontroversial This work is generally agreed upon A-Physics Collisions, kinematics, forces and more labels Aug 21, 2025
Copy link

@Demonagon Demonagon left a comment

Choose a reason for hiding this comment

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

Hi, thanks for contributing. Changing the schedule from fixed time to virtual time could make the game behave differently with large delays in time, where the ball could move beyond an obstacle. Do you think that's a fair assesment ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Physics Collisions, kinematics, forces and more C-Examples An addition or correction to our examples D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward X-Uncontroversial This work is generally agreed upon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants