Send enemy waves into an arena and unlock the door only after the last one
A locked room with waves of enemies is a classic, and it breaks in three ways: the next wave comes only when the last enemy dies and the fight stalls, waves overlap into a crowd, or the door opens too early. This entry shows when to call each wave and when the room is truly done.
Why this works
The rhythm of a fight comes from overlap: a new wave should arrive while some of the old one still stands. Counting those on their way as well as those present, and allowing only so many at once, keeps the room readable.
When not to use it
Skip it when the room should feel open, or when players can leave the fight and return. Locking someone in can feel cruel in a tough game; offer an exit, or let a boss kill end the lock.
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
- 27 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 "Send enemy waves into an arena and unlock the door only after the last one" (read_entry arena-waves-that-open-the-door-at-the-end) 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