Bouncing off an enemy's head, higher when the jump key is held
Jumping on enemies sounds simple until the character takes damage from the side of an enemy it clearly landed on, bounces twice off one enemy, or bounces the same low height whatever the player does. Here is how to decide stomp or hit and what the bounce gives.
Why this works
The player judges a stomp by whether they came down on the enemy, not by where they ended up after a fast fall. Looking at where the feet were a moment earlier matches what was seen, and one bounce per landing keeps the reward readable.
When not to use it
Skip it for enemies that must not be jumped on, such as spiked or fiery ones, and for games without a hero who can jump. Mark those clearly, since the player will try, and let them hurt from every side.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 29 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 "Bouncing off an enemy's head, higher when the jump key is held" (read_entry stomp-bounce-higher-when-jump-held) 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