Fly confetti with air drag so it floats down, and know where it is at any time
Confetti that only falls with gravity drops like stones. Adding air drag makes it float, but stepping it frame by frame gives different results on different phones, and you cannot skip ahead to a frame for a replay. A closed formula solves all three. Here it is, with the check that proves it matches a slow simulation.
Why this works
The path of a piece is fully set by its launch, so its place at any moment can be worked out directly. That removes the dependence on frame speed and lets you jump to any moment, for replays or to check the motion.
When not to use it
Do not use it when pieces react to things along the way, such as wind gusts, walls or the player's hand. The path then changes mid-flight, so the straight calculation no longer holds. Step forward in small moves.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 25 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 "Fly confetti with air drag so it floats down, and know where it is at any time" (read_entry casual-confetti-you-can-jump-to-any-moment-of) 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