Maze Game: A Guide

What Is This Game?

The Maze Game is the first game in the tower which you must escape. It’s a top-down maze game where you navigate through a twisting network of corridors, walls, and barriers to reach a final NPC hidden deep within the maze. There are no enemies — only the labyrinth itself, your wits, and the quiet dread of realizing you’ve been walking in circles for the last five minutes.

The goal is simple: you must find the NPC. Getting there is quite the challenge.


Try It Yourself

Use WASD to move through the maze. Reach The Keeper at the end to win!

Challenge

Navigate the maze using WASD keys. Find your way through the barriers and reach The Keeper NPC waiting at the end. Can you find the path?

Lines: 1 Characters: 0
Game Status: Not Started

🏗️ Design Overview

Before writing any code I planned the level around three goals:

Goal Why it matters
Two-layer structure The outer RPG layer (cave entrance + Gate Keeper) gives the maze context and weight before the player even enters.
The maze is always solvable Barriers are fixed and hand-placed so there is always exactly one valid path to the Exit Warden.
NPCs reward exploration The Whispering Shadow and Lantern Keeper are placed in dead ends and open cells — players who explore find help.

Every code system in this level exists to serve one of these three goals.


The Maze

The maze is procedurally generated each run, meaning no two playthroughs are the same. Walls shift. Dead ends appear where open paths used to be. The layout is always unique, always cruel, and always fair.

Key Features of the Maze

  • Barriers — Solid stone walls that cannot be passed. Some are permanent; others are triggered by pressure plates or switches hidden throughout the level.
  • Moving Walls — Certain sections of the maze have sliding barriers that open and close on a timer. Time your movement carefully or get trapped.
  • One-Way Passages — Narrow corridors with gates that only allow movement in one direction. Think carefully before you enter.
  • Fog of War — You can only see a short radius around your character. The rest of the maze is shrouded in darkness. Exploration is the only way forward.
  • Dead Ends — Lots of them. On purpose. Learn to love them.

The Barriers

Not all obstacles are walls. The maze throws several types of barriers at you:

Barrier Type Description Can Be Bypassed?
Stone Wall Permanent, impassable ❌ No
Iron Gate Locked until a key is found ✅ With a key
Pressure Wall Closes when you step on a trigger tile ⚠️ With timing
Spike Trap Damages and pushes you back ✅ With dodge roll
Crumbling Floor Collapses after one crossing ✅ Once only
Mirror Barrier Reflects your movement direction 🔄 Disorienting

Learning which barriers can be overcome — and how — is core to mastering the game.


🗂️ Architecture Summary

GameLevelMaze (outer layer)
├── Cave background              → sets the dark dungeon atmosphere
├── Gate Keeper NPC              → dialogue + fade transition into sublevel
└── GameControl (nested)         → launches GameLevelMazeSub on interaction

GameLevelMazeSub (the maze itself)
├── Hand-placed barrier grid     → 3 rows horizontal + vertical columns
├── b() helper function          → converts relative coords to absolute pixels
├── Whispering Shadow NPC        → cryptic hints, placed in open bottom cell
├── Lantern Keeper NPC           → mid-maze guidance, open cell between walls
├── Exit Warden NPC              → top-right, triggers transition to GameLevelDoors
└── cleanAndTransition()         → fade + canvas wipe + transitionToLevel()

Getting lost is part of the experience. But here are a few tips to help you stay sane:

  1. Hug the left wall. The classic maze-solving trick. Place your hand on the left wall and keep it there. You’ll eventually find the exit — or at least map the perimeter.
  2. Listen for the NPC. As you get closer to the final NPC, you’ll begin to hear faint sounds — a whisper, a soft hum, a distant echo. Follow the audio cues.
  3. Mark your path. The game lets you place chalk markers on the ground. Use them liberally. A dead end marked is a dead end you’ll never waste time on again.
  4. Check for switches. If a passage seems completely sealed, look around for a pressure plate, lever, or hidden tile nearby. Very few dead ends are truly final.
  5. Don’t rush the moving walls. Wait, observe the pattern, count the beats, then move. One mistimed step can seal you in a corridor with no way out.

The Final NPC

At the heart of the maze waits The Keeper — a cloaked figure seated at a stone table, surrounded by candles that never seem to burn down.

The Keeper doesn’t fight you. They don’t run. They simply wait.

When you finally reach them, an extended dialogue sequence begins. The Keeper speaks about the maze — its history, its purpose, and what it means that you found your way through. The conversation changes depending on how long you took, how many dead ends you hit, and whether you broke any walls using the hidden sledgehammer item.

“You’re not the first to walk these halls. But you are the first to arrive looking so… thoughtful.” — The Keeper

Reaching the Keeper unlocks the ending cutscene and reveals the lore behind the labyrinth. There are three possible endings, determined entirely by your choices during the Keeper’s dialogue.


Why It Works

What makes this game compelling isn’t the complexity of the maze — it’s the tension between exploration and anxiety. Every corridor could be a shortcut or a trap. Every open space feels like a gift and a setup.

The absence of enemies means the stakes feel different. You’re not fighting anything. You’re just… searching. And somehow, that’s more unsettling.

When you finally stumble into that central chamber and see the Keeper’s candlelight flickering in the dark, the relief is real. You earned it.


💡 What I Learned

Game design: Building the maze as two separate levels — an outer RPG layer and the maze itself — made the experience feel much more intentional. The Gate Keeper gives the player a moment to breathe and choose before committing.

JavaScript: The b() helper function for converting relative coordinates to absolute pixels was a huge quality of life improvement. Placing barriers by percentage of screen width and height means the maze scales correctly to any screen size without recalculating every number manually.

Debugging: The canvas stacking bug affected this level too. Every time the sublevel launched, old canvases piled up in #gameContainer. The fix — wiping all children except #promptDropDown before calling transitionToLevel() — is now standard across every level transition in the game.


Final Verdict

Maze Game is a quiet, focused experience that trusts the player to find their own way — literally. The barrier system adds mechanical depth without overcomplicating things, the maze generation keeps it fresh, and the final NPC gives the journey a sense of meaning that pure puzzle games often lack.

It won’t be for everyone. But for those who like to wander, think, and discover — it’s exactly the kind of game that sticks with you long after you’ve found the exit.


Happy wandering. Try not to get too lost.


Tags: maze puzzle exploration indie game NPC dungeon narrative