# Check the paths between game states

> Map a browser game's start, play, pause, win and loss states, then test every transition and the inputs that should be ignored.

- URL: https://oneshotgems.ai/topics/testing-game-state-transitions
- Category: For game developers
- Type: Guide
- Updated: October 5, 2026

Many awkward game bugs happen between stable screens: a start click is accepted twice, a pause menu leaves movement active, or a victory overlay appears while the timer keeps running. A state-transition test names the states, the action that moves between them, and the behavior that should stop or begin at that boundary. This is different from checking each screen in isolation because a screen may look right while hidden input or score logic continues underneath it.

## Draw a small state map

Start with only the states that exist today: ready, playing, paused, won, lost. List valid transitions such as ready to playing on Start, playing to paused on Pause, paused to playing on Resume, and playing to lost after a collision. Decide whether won or lost can transition to playing directly or must pass through ready. A tiny map exposes impossible routes before you add more screens or features.

## Test duplicate and out-of-state input

Try the same transition twice quickly: double-click Start, press Pause twice, or hit Restart while the win panel is opening. Each state should handle repeated input deliberately instead of creating duplicate timers or overlays. Also press a gameplay key while paused or after losing. Decide whether the action is ignored, queued, or used by a menu, then verify the selected rule.

## Questions

**Which game states should I test first?** Cover the states that block play or end a run: ready, active play, pause, win or loss, and restart. Add intermediate screens when they change available actions.

**Should gameplay input work while a pause menu is open?** Choose a rule and test it. Many games ignore movement while paused, but menu navigation may remain active; the important part is a consistent, visible distinction.

## Follow your curiosity

- [Write Acceptance Criteria for a Game Prompt](https://oneshotgems.ai/topics/game-prompt-acceptance-criteria): Translate a game idea into testable acceptance criteria with clear actions, outcomes, failure cases and a deliberately small first scope.
- [Test Save State in a Browser Game](https://oneshotgems.ai/topics/testing-game-save-state): Verify what a browser game saves, what resets, and how it behaves when stored data is missing, stale or changed between sessions.

## Further reading

- [MDN History API guide](https://developer.mozilla.org/en-US/docs/Web/API/History_API/Working_with_the_History_API)

---
Canonical page: https://oneshotgems.ai/topics/testing-game-state-transitions
