Drop an item that bounces a few times and then really comes to rest
A dropped coin or ball that bounces by flipping its speed each frame either jitters on the floor forever or sinks into it, and its timing depends on the frame rate. Here is how to know the exact moment of every bounce and when to stop.
Why this works
Each bounce keeps only part of the speed, so every hop is lower and shorter and the sum of all the hops is a fixed time. Stopping once a bounce is too small to see gives a clean ending where a simulation would creep and jitter.
When not to use it
Not when the item can be pushed, rolls away or lands on something moving or tilted. A fixed schedule knows only a straight drop to flat ground, so there let real physics decide each bounce.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- 38 lines of example code with 4 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Drop an item that bounces a few times and then really comes to rest" (read_entry dropped-ball-bounces-that-really-stop) in my game. Build it step by step, and show me how you checked that it works.Or skip this and connect the MCP: your AI then finds all of this by itself.Connect the MCP