Build a dungeon game where everyone takes turns and fast creatures act more often
A turn-based dungeon crawl waits for the player, then lets every creature act. Giving some creatures more actions than others fairly is where the fuss starts. Here is a scheduler that handles speed, bumping into things to fight, and death, all in a few lines.
Why this works
A fast creature simply earns its turns sooner, so no exceptions are needed. One shared counter that every creature fills at its own speed gives each the right share of the time, and keeping the surplus keeps it exact.
When not to use it
Skip it when everything should move at once in real time, or when all sides take strict turns in a fixed order, such as a board game. There the speed counter adds a complexity nobody sees.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- A diagram of every state
- 61 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 "Build a dungeon game where everyone takes turns and fast creatures act more often" (read_entry genre-dungeon-turn-loop-core) 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