Maze Escape Game

Use the arrow keys (or the on-screen buttons) to move your character and find the exit of a maze that's freshly generated every time.

Moves: 0Time: 0s

Use the keyboard arrow keys or the buttons above to move.

How to play

Start from the green square (the start point) and move your character using the arrow keys or the on-screen direction buttons until you reach the red square (the exit). The maze is randomly generated by an algorithm every time you start a new game, so you'll never see the same maze twice. Your move count and elapsed time are both tracked, so try to escape as quickly as possible with the fewest moves.

How is the maze generated?

This game's maze is freshly generated every time using a well-known maze generation algorithm called recursive backtracking. Starting from the entrance, it carves a path in a random open direction and backtracks whenever it hits a dead end, guaranteeing a fully connected maze with at least one path from the start to the exit.

Frequently Asked Questions

Does the maze have more than one path?

A maze generated by this algorithm is a "perfect maze," meaning there's exactly one path between any two points. In other words, there are branching paths, but reaching the exit may require backtracking out of dead ends.

Can I play this on mobile?

Yes β€” you can tap the on-screen direction buttons to move, so it works even without a keyboard on mobile.