Throw an item in an arc that peaks where you choose and lands on time
Loot flying to a chest, a potion thrown at a target, a frog jumping to a lily pad: you know where it starts and ends and want a nice arc of a certain height in a certain time, with any gravity feeling. Here is how to work out the arc that fits.
Why this works
A thrown thing falls along a smooth arch, and the arch is fixed by how high it goes and how long it flies. Working out gravity from those two wishes, rather than the other way round, lets you decide the feel and still land exactly.
When not to use it
Skip it when throws should depend on real power and angle chosen by the player, as in a catapult game where missing is part of the fun. There, start from speed and angle and let the landing spot follow.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- 33 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 "Throw an item in an arc that peaks where you choose and lands on time" (read_entry thrown-item-flies-an-arc-of-chosen-height-and-time) 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