Spielerando

Landing half on a haystack and half on stone: how much does it hurt?

Soft landings are a great survival trick, but bodies are wider than one block. Check only the spot under the middle and a player on the very edge of a hay bale is saved or hurt for no visible reason. Here is how to weigh what the feet actually touch.

Why this works

A body has width, so a landing is not decided by one point. Weighing each surface by how much of the feet rests on it gives a result that changes smoothly with position, so two nearly identical landings never end in very different harm.

When not to use it

Skip it in a game with a coarse grid where the character always stands in exactly one cell. Weighing overlaps adds work and nobody sees the difference, so one simple lookup is better.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 3 common mistakes and the fix
  • 21 lines of example code with 5 checks that pass
  • How your AI shows you that it works

Say this to your AI

Use the Spielerando entry "Landing half on a haystack and half on stone: how much does it hurt?" (read_entry landing-between-soft-and-hard-blocks) 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