Spielerando

Lunge an attacker at its target, stop in front of it and step back

In turn-based fights the attacker dashes forward, strikes and returns. Moving to the target's centre puts one sprite inside the other, and an attacker already standing close would run backwards first. Here is how to find the stopping spot, time the hit and glide home.

Why this works

Bodies have size, so the place to strike is not the target's middle but the spot where the two bodies just touch. Speeding up toward the hit and slowing on the way home gives the blow weight and the return a settled feel.

When not to use it

Skip it for ranged attacks, spells and attackers that do not move, such as a tower or a caster standing back. Let the effect travel to the target instead, so the attacker stays in place and the line of fire stays readable.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 4 common mistakes and the fix
  • 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 "Lunge an attacker at its target, stop in front of it and step back" (read_entry turn-based-attacker-lunges-and-stops-at-the-target) 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