Quick answer: Use pygame.math.Vector2.reflect(normal) with the surface normal so the angle of reflection equals the angle of incidence, even on slanted walls.

A bouncing ball that behaves on flat walls but goes the wrong way off angled surfaces is flipping a single axis instead of reflecting about the normal. Vector2.reflect gives a correct bounce. Here is the fix.

How to fix it

1. Use Vector2.reflect

Replace vy = -vy with velocity = velocity.reflect(normal), where normal is the unit surface normal at the contact point. This reflects only the component along the normal.

2. Use the real surface normal

Compute or store the normal of the surface that was hit rather than assuming a horizontal or vertical wall, so angled paddles and ramps bounce at the correct angle.

3. Apply restitution by scaling

To model energy loss, multiply the reflected vector by a bounciness factor below 1 rather than altering the reflection math, keeping the angle correct while reducing speed.

Catching the ones you can't reproduce

The hardest version of this to fix is the one you can't reproduce — it only happens on a player's hardware, OS, driver, or save state, under conditions that simply aren't present on your machine. A report that says “it crashed” or “it froze” gives you nothing to act on, so the bug survives release after release while quietly costing you players.

Automatic error capture closes that gap. Each failure arrives with its full stack trace, the device and OS, the build number, and a breadcrumb trail of what the player did right before it broke, so even a failure you have never seen becomes a specific, reproducible issue. Fold identical failures into one signature ranked by how many players each hits, and your worklist sorts itself worst-first instead of arriving as a stream of vague complaints.

This is where a tool like Bugnet earns its place. Its SDK captures every Pygame error automatically with the full stack trace plus device, OS, memory, build, and game-state context, folds duplicates into one grouped issue with an occurrence count, and ties each to the build it first appeared on — so you fix the problem that hurts the most players first and confirm it is gone when its signature disappears from the next release.

The bug you can't reproduce isn't gone — it's just invisible until you capture it from the player's device.