Level: 1/10 Time: 0.0s Score: 0 Best: --

LABYRINTH

Navigate the holographic maze. Reach the magenta exit before the timer drains your score. Use WASD or arrow keys — or the on-screen pad on mobile.

How to Play Labyrinth

Labyrinth is a free online maze game — a top-down procedural maze runner with a holographic aesthetic, playable in any browser with no download. Each level draws a fresh maze using a recursive-backtracker algorithm seeded by your level number. Walls render as translucent cyan panels with a faint purple inner glow against a dark navy floor of glowing grid lines, and the exit cell pulses magenta in the bottom-right corner.

Move one cell per keypress (or D-pad tap). When you reach the exit, a wave of holographic light expands outward, the screen shakes, and you advance to the next maze. Each level grows by two cells per side, capping at 25x25. Clear all 10 levels to submit your run to the leaderboard. Faster clears score higher.

Modes

Controls

Frequently Asked Questions

How is each Labyrinth maze generated?
Every level uses a recursive backtracker (depth-first search) algorithm with a seeded mulberry32 PRNG. The DFS guarantees a spanning tree, so every maze has exactly one path between any two cells and is always solvable. Grids start at 15 cells per side at level 1 and grow by 2 per level up to a 25x25 cap.
What is the Daily Challenge?
The Daily Challenge serves a single deterministic 19x19 maze keyed to today's date (YYYY-MM-DD). Every player worldwide gets the exact same maze, so leaderboard times are directly comparable. Daily best times persist in localStorage per date, and the daily mode submits to a separate leaderboard.
How is the score calculated?
Each level awards max(1000 - elapsedSeconds*5, 100) points — finishing fast scores high, and there is a 100-point floor so even a slow clear earns something. Scores accumulate across all 10 levels. A Speedrunner achievement triggers if you clear the entire run in under 90 seconds.
Does Labyrinth work on mobile devices?
Yes. An on-screen 4-button D-pad appears below the canvas on touch devices, with touchstart events that preventDefault to stop accidental scrolling. Desktop uses WASD or arrow keys with the same preventDefault on directional input. The 640x640 canvas scales responsively.

Inside the Recursive-Backtracker Algorithm

Every Labyrinth maze is carved by a depth-first search that walks the grid from the top-left cell, knocking out one wall at a time as it visits new neighbours. When a cell has no unvisited neighbours, the algorithm backtracks along its stack until it finds one that does, repeating until every cell has been touched exactly once. The trail it leaves behind is a spanning tree, which is a fancy way of saying there is exactly one path between any two cells and no isolated pockets. That mathematical property is why the maze is always solvable — the generator cannot produce an island, a loop, or a dead exit no matter how chaotic the layout looks.

The randomness itself comes from a mulberry32 pseudo-random generator seeded from your level number, so level 3 of a fresh run produces exactly the same maze as level 3 of yesterday's run. The result is essentially a new random maze generator every run, plus a single daily maze puzzle shared across all players. The Daily Challenge swaps in a date-derived seed so every player worldwide gets the same 19x19 grid until midnight rolls over. If procedural worlds appeal to you, our top-down explorer Wander uses a related dungeon-carving technique to lay out its rooms and corridors.

Visual Design Choices Behind the Hologram Aesthetic

The holographic look is layered out of small ingredients. The floor draws a fine cyan grid every 32 pixels with a brighter purple grid every 128 pixels stacked on top, which gives the canvas a sense of depth without using textures. Walls are stroked in cyan over a faint purple panel fill, then run through a shadow blur set to purple so each segment glows from the inside. A shimmer multiplier driven by a sine wave nudges the alpha of every wall up and down once every couple of seconds, which is what gives the maze its breathing quality.

The exit cell pulses magenta and carries its own chevron pointer so it stays readable even when the wall shimmer is at peak brightness. When you touch it, a cyan light wave expands from your avatar, the canvas shakes for a few frames, and a floating score chip rises out of the exit. Ambient cyan and purple particles drift upward across the floor at all times, including on the title screen, so the playfield never feels static.

Idle Hints and Other Quality-of-Life Touches

Stand still for more than five seconds and the four cells next to you start glowing softly in cyan, marking which directions are not blocked by a wall. The hint never reveals the route to the exit — it just pushes back against the moment where you stop seeing the openings in front of you. The faint white breadcrumb trail behind your avatar serves the same role from the opposite angle, showing where you have already been so you can rule out repeat moves at a glance.

Every level kicks off with a "LEVEL N" banner fading in over the grid dimensions, and bumping a wall produces a sawtooth blip plus a quick screen shake so missed inputs feel acknowledged rather than swallowed. The mute toggle remembers your choice in localStorage, and best scores for both classic and the current daily survive across reloads. If you are in the mood for a different kind of focused timing game after a hard maze, the rhythm-tap challenge Cadence sits in a similar quick-session bracket.