Spielerando

Let a piercing shot hit several enemies for less, but stop at walls

A shot that goes through enemies sounds fun until it hits them in the wrong order, ignores a wall in between, or does a decimal of damage. This entry gives the rules for who is hit, in what order, and for how much.

Why this works

A shot travels along a line, so what it meets first matters most. Putting the targets in order along that line, letting each hit weaken the shot, and stopping at anything solid makes the result match what the player pictures.

When not to use it

Skip it when a shot should be strong against exactly one target, like a sniper duel, or when your game is meant to be about hitting one enemy at a time. Use a plain single hit, or an area effect if crowds should suffer.

In the full entry

  • What to build, step by step
  • Starting values and the reason for each
  • 3 common mistakes and the fix
  • 25 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 "Let a piercing shot hit several enemies for less, but stop at walls" (read_entry piercing-shot-damage-falloff-and-walls) 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