The level timer keeps running while the player is in another app
A phone call or a message and the timed puzzle is lost, or the clock jumps by minutes when the player returns. Games must treat time away as paused time. Here is a stopwatch that survives pauses, and why one big frame step should never be allowed to count.
Why this works
Time away is not time played. So you record when the clock started and how much it had gathered, and you stop the clock whenever the player leaves, instead of adding up small slices that a long absence turns into one huge, unfair one.
When not to use it
Skip the pause when time passing is the point, as in a game about real-world waiting, a daily puzzle with a fixed deadline or a live event. There the clock should keep going, and the game should say clearly what was missed while away.
In the full entry
- What to build, step by step
- Starting values and the reason for each
- 3 common mistakes and the fix
- 33 lines of example code with 5 checks that pass
- How your AI shows you that it works
Say this to your AI
Use the Spielerando entry "The level timer keeps running while the player is in another app" (read_entry timed-level-keeps-counting-in-the-background) 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