Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 14, 2025

The bounce animation was visually misaligned—appearing too low with the top of the bounce at what should be the center position.

Root cause

bounceOffset ranged from 0 to 50, causing unidirectional downward motion instead of symmetric oscillation around center.

Changes

Shifted offset range from [0, 50] to [-25, 25] by subtracting half the amplitude:

// Before: offset only went down (0 to 50)
bounceOffset = MathF.Abs(MathF.Sin(animationTime * 3)) * 50;

// After: offset oscillates symmetrically (-25 to 25)
bounceOffset = (MathF.Abs(MathF.Sin(animationTime * 3)) * 50) - 25;

Ball now bounces symmetrically around its starting position rather than only below it.

Original prompt

This section details on the original issue you should resolve

<issue_title>Bounce animation demo is misaligned</issue_title>
<issue_description>I think this should be adding half of the offset as currently it is too low and it looks like the top of the animation is where the middle of the animation would be.

Originally posted by @Damon3000s in #132 (comment)
</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


Note

Centers the bouncing animation by adjusting bounceOffset to oscillate symmetrically around zero (-25 to 25).

Written by Cursor Bugbot for commit d42f3d9. This will update automatically on new commits. Configure here.

Co-authored-by: matt-edmondson <19528727+matt-edmondson@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix misalignment in bounce animation demo Center bounce animation by adjusting offset range Nov 15, 2025
Copilot AI requested a review from matt-edmondson November 15, 2025 00:05
@matt-edmondson matt-edmondson marked this pull request as ready for review November 15, 2025 00:06
@matt-edmondson matt-edmondson merged commit 45e8a6a into main Nov 15, 2025
3 checks passed
@github-project-automation github-project-automation bot moved this to Done in ktsu.dev Nov 15, 2025
@matt-edmondson matt-edmondson deleted the copilot/fix-bounce-animation-alignment branch November 15, 2025 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Bounce animation demo is misaligned

2 participants