Make a trap catch the enemy who walks onto it, and only once
Traps in a turn-based map need a few firm rules: who sets them off, where the walker ends up, and what happens to the rest of the move. Without them a trap is either harmless, hits friends, or fires again and again. Here are the rules in a short routine.
Why this works
A trap is a promise: step here and it costs you. For that to feel fair, it has to hit only the side it was set against, catch the walker where it stands, and be used up, so one mistake is not paid for twice.
When not to use it
Skip it when movement is free and real-time, or when hidden dangers would feel like cheap punishment for a player with no way to spot them. Give a visible hazard or a warning sign instead.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 4 common mistakes and the fix
- 24 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 "Make a trap catch the enemy who walks onto it, and only once" (read_entry traps-trigger-once-and-stop-the-walker) 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