Walking off a ledge should not give a free extra jump
A character with a mid-air jump behaves oddly when it simply walks off a ledge: sometimes two jumps remain, sometimes none, depending on small details. Here is a consistent rule and the numbers that prove it holds on every path.
Why this works
The player thinks of jumps as a small supply for one trip through the air, not as separate kinds. If the first jump is lost by walking off, the supply is smaller. Counting from one pool keeps the rule easy to say and impossible to cheat.
When not to use it
Skip it if your game gives a clear, separate extra jump as a reward or power-up, which is meant to be on top of the normal one. Then keep the pools apart and tell the player, so the bonus is a gift they can see.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- A diagram of every state
- 31 lines of example code with 3 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "Walking off a ledge should not give a free extra jump" (read_entry air-jump-count-after-walking-off-ledge) 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