Check that a level with single-use keys can still be finished
If a key is used up by the door, the player can lock themselves out by spending it on the wrong one. A simple walk through the rooms says everything is fine while a real player can get stuck. Here is a check that tries the orders.
Why this works
When a key is used up, the order of choices decides the outcome, so a quick look at what is reachable is not enough. Trying every order of opening, and remembering which situations were already seen, is the only way to be sure a dead end cannot trap the player.
When not to use it
Too slow for a level with dozens of locks, and pointless if keys are never used up or levels are made by hand and tested by playing. Then reduce the number of locks, or have a person play through each level once.
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
- 34 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 "Check that a level with single-use keys can still be finished" (read_entry survival-keys-that-vanish-when-used) 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