Welcome to Labyrinth | Maze Explorer! ๐ฎ
This is a fun and interactive web game where players solve randomly generated mazes by tracing a path using the W, A, S, D keys. The maze is generated dynamically, and you can save your solved maze as PNG, JPG, or PDF.
โญ GAME HIGHLIGHTS โญ
- ๐๏ธ Random Maze Generation using the recursive backtracking algorithm
- ๐ฉ Start Cell: Highlighted in Green (Topโleft corner, (0,0))
- ๐ฅ Finish Cell: Highlighted in Red (Bottomโright corner)
- ๐ฆ Path Drawing: Use W, A, S, D to trace a blue path
- ๐ Backtracking Allowed: Undo steps by retracing your path
- ๐ Game Completion: Dialog prompts a choice to start a new maze or exit
- ๐ค Export Options: Save maze as PNG, JPG, or PDF
- ๐ Prevents Page Scrolling: Moving with WASD does not scroll the page
1๏ธโฃ Generate a Maze
Click the "Generate New Maze" button to create a new maze. The game will highlight the Start Cell (Green) and the Finish Cell (Red).
2๏ธโฃ Move Through the Maze
Use the W, A, S, D keys to trace your path:
- W: Move Up โฌ๏ธ
- A: Move Left โฌ ๏ธ
- S: Move Down โฌ๏ธ
- D: Move Right โก๏ธ
Your path is drawn in blue. If you backtrack, the last step is removed.
3๏ธโฃ Complete the Maze
Once your blue path reaches the Finish Cell, a message will appear:
- โ Click OK to generate a new maze (clears previous solution)
- โ Click Cancel to exit the game
4๏ธโฃ Export Your Maze
Use the export buttons below the canvas to download your solved maze as PNG, JPG, or PDF.
โ๏ธ Fully Interactive Maze Solver
โ๏ธ Lightweight Web Game (No Installation Required)
โ๏ธ Dynamic Path Tracing (Backtracking Supported)
โ๏ธ Auto-Clearing Previous Solutions when generating new mazes
โ๏ธ Prevent Default Page Scrolling when using movement keys
โ๏ธ Built-in Export Options (PNG, JPG, and PDF)
- ๐ต HTML5 Canvas for rendering the maze
- ๐จ JavaScript for maze generation & interaction
- ๐ CSS for styling
- ๐ผ๏ธ jsPDF for PDF export
- ๐ฑ๏ธ Event Listeners for keyboard movement controls
Want to save your maze? Use the built-in export buttons:
- ๐ผ๏ธ PNG Export: Saves your maze as a high-quality PNG image
- ๐ธ JPG Export: Saves your maze as a JPG photo
- ๐ PDF Export: Saves your maze as a PDF file (powered by
jsPDF
)
๐ก Future Improvements:
- โณ Timed Mode โฑ๏ธ (Challenge yourself to solve the maze quickly)
- ๐ Leaderboard Support (Track best completion times)
- ๐ Multiplayer Mode (Race against friends to solve mazes)
If you'd like to contribute, feel free to submit feature suggestions or pull requests! ๐
๐ Example Maze Preview:
(Insert sample images of the maze in action)
๐ค Exported Maze Example:
(Include an exported PNG/JPG/PDF sample)
๐จโ๐ป Bocaletto Luca
Made with โค๏ธ and JavaScript!
If you enjoy Labyrinth - Maze Explorer, feel free to โญ star the repository or contribute to its development. ๐
This project is licensed under the GPLv3 License.
Feel free to use, modify, and distribute it freely! ๐