A fun and interactive web-based Maze Game built using HTML, CSS, and JavaScript with a canvas-based visualization of a procedurally generated maze. Navigate the player from start to finish without revisiting any cell, or you'll need to restart!
- ๐จ Maze Generation: Dynamic maze generated using recursive backtracking.
- ๐ง Player Navigation: Move using arrow keys or on-screen direction buttons.
- ๐ Restart Logic: If a previously visited cell is entered, a restart message is shown.
- ๐ Win Detection: Game ends successfully when the player reaches the bottom-right cell.
- โจ Scoreboard:
- +10 points for valid moves.
- -10 points for invalid moves (with a lower bound of 0).
- ๐ง Solution Path Validation: Ensures user remains within the solvable maze path.
MazeGame/ โ โโโ index.html # Main HTML structure โโโ style.css # Styling for UI elements โโโ (All scripts are inline inside index.html)
-
Clone the Repository
git clone https://github.com/your-username/maze-game.git cd maze-game
2.Run in Browser
Simply open index.html in your web browser.
OR
Use Live Server in VS Code
Install Live Server Extension
Right-click on index.html and choose "Open with Live Server"
๐ง Controls Start: Click the Start button to generate a new maze.
Move Player:
Keyboard: Use ArrowUp, ArrowDown, ArrowLeft, ArrowRight
Buttons: Click the corresponding Up / Down / Left / Right buttons
๐ Scoring Rules +10 for each valid move.
-10 for each invalid move (score cannot drop below 0).
Visiting a previously visited cell ends the game and shows a restart option.
๐ Future Improvements โฑ๏ธ Add a timer for speed-based scoring.
๐พ Save high scores in browser local storage.
๐ง Add AI-based auto-solver visualization.
๐ฎ Support for difficulty levels (larger maze sizes).
๐ค Contributing
Contributions are welcome! Feel free to fork the repo and submit pull requests.

