This repository contains a simple maze game implemented in JavaScript. Players navigate through a maze from the start point to the end point using arrow keys or swipe gestures. The game includes features such as customizable difficulty levels, a victory message display, and the ability to load custom sprites for the player and end point.
To get started with the maze game, follow these steps:
-
Clone the repository to your local machine:
git clone https://github.com/your-username/maze-game.git
-
Open the
index.html
file in a web browser to play the game.
You can customize the difficulty of the maze by selecting the difficulty level from the dropdown menu.
The game allows you to load custom sprites for the player and the end point. The provided example includes a key sprite for the player and a home sprite for the end point. You can replace these sprites with your own by modifying the sprite.src
and finishSprite.src
paths in the JavaScript code.
sprite.src = "./path/to/your/player-sprite.png";
finishSprite.src = "./path/to/your/end-sprite.png";
Make sure to set the appropriate paths for your custom sprites.
The game is responsive, and the maze adjusts its size based on the dimensions of the container element (#view
). You can resize the window, and the maze will adapt accordingly.
The maze game is implemented using HTML, CSS, and JavaScript. The key functions and components include:
-
Maze Generation: The maze is dynamically generated using a randomized depth-first search algorithm.
-
Player Movement: Players can navigate through the maze using arrow keys or swipe gestures.
-
Sprite Customization: Custom sprites for the player and end point can be loaded and adjusted for brightness.
-
Responsive Design: The game adapts to different screen sizes, providing a consistent experience on various devices.
Feel free to contribute to the project by creating issues, suggesting enhancements, or submitting pull requests. Your feedback and contributions are welcome!
This maze game is open-source and available under the MIT License.