A sword swing that hits an enemy ten times in one slash
The damage area of an attack exists for several frames, so one slash can hurt the same enemy over and over, or miss because the area is there before the swing looks ready. Here is the timing of start, hit and recovery, and the memory that fixes the repeat.
Why this works
One swing is one decision, so it should cost an enemy once. Keeping a list of who this swing already hit makes the damage independent of how long the danger zone lasts or how fast the screen draws, and the wind-up tells the player it is coming.
When not to use it
Do not limit it when the weapon is meant to hit repeatedly, such as a flamethrower, a spinning blade or a beam. Give those a short wait before the same target can be hit again, so damage still comes in steady steps.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- A diagram of every state
- 31 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 "A sword swing that hits an enemy ten times in one slash" (read_entry swing-hits-each-enemy-only-once) 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