Treasure Hunt is a fully static browser game — there is no framework to install, no build step to run, and no server-side component. The entire game lives in one HTML file, one CSS file, and three JavaScript ES modules. You can have it running locally in under a minute with a single terminal command, or publish it to the web via GitHub Pages without writing a single line of configuration.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/treasure-hunt-game/llms.txt
Use this file to discover all available pages before exploring further.
The game is purely static. There is no bundler, no
npm install, and no build step required at any point — locally or in production. All JavaScript files use native ES module import/export syntax supported by every current browser.Prerequisites
- A modern browser (Chrome, Edge, Firefox, or Safari — current versions).
- Optional: Python 3 installed locally if you want to serve the files through a local HTTP server. This is recommended because ES module imports resolve correctly over HTTP but may be blocked by some browsers when opening files directly from the filesystem via
file://URLs.
Run Locally
Clone or download the repository
Obtain the project files by cloning the repository or downloading the ZIP from GitHub. Make sure the folder structure is intact —
index.html must sit at the root level alongside assets/.Start a local HTTP server
From the project root, run the Python built-in static file server:You should see output similar to:
Opening index.html Directly Without a Server
You can double-click index.html to open it directly in your browser via a file:// URL. The game will typically work in Chrome and Edge, but some browsers block ES module cross-origin imports when loaded from the filesystem. If the board does not render or the console shows a CORS or module-loading error, use the python -m http.server 8000 approach above instead.
Deploy to GitHub Pages
Upload the project to a GitHub repository
Create a new public repository on GitHub and push all project files. Verify that
index.html is committed at the repository root — not inside a subfolder.Confirm index.html is in the repository root
GitHub Pages serves from the root of the selected branch by default. The path
index.html must resolve directly — if it is nested inside a folder, Pages will show a 404.Confirm .nojekyll is in the repository root
The project includes a
.nojekyll file. This file tells GitHub Pages to skip the Jekyll build process, which is required because Jekyll ignores files and folders that begin with an underscore — and without it, some asset paths can break silently.If the file is missing, create it:Enable GitHub Pages in repository settings
- Open your repository on GitHub.
- Go to Settings → Pages.
- Under Build and deployment, set the source to Deploy from a branch.
- Select your branch (typically
main) and the / (root) folder. - Click Save.
https://<your-username>.github.io/<your-repo>/. The first deployment usually takes about a minute to go live.Your First Game
Once the page is open, follow these steps to play your first race:Select a difficulty
Use the Agent Difficulty dropdown to choose Easy, Medium, or Hard. Easy gives the agent a 1600 ms head-start delay and a 42 % exploration rate, so it frequently wanders off the optimal path. Hard sets a 350 ms start delay and a 0 % mistake rate — the agent follows the BFS-optimal path without hesitation.If this is your first time, start with Easy.
Generate a new maze
Click New Maze. The board regenerates with a freshly randomized 8×8 layout. The Game Log at the bottom will show the shortest route length for the new board, for example:
Start the race
Click Start Race. The status pill changes to Race Running and the agent begins moving on its timer interval. The agent is shown on the board as 🤖 and you are shown as ●.
Move to the X
Navigate through the maze using the keyboard or on-screen controls:
Reach the X at cell
| Input | Direction |
|---|---|
ArrowUp or w | Up |
ArrowDown or s | Down |
ArrowLeft or a | Left |
ArrowRight or d | Right |
[7, 7] before the agent does. The status pill will display You Found the X if you win, or Agent Found the X if the agent gets there first.