Git Product home page Git Product logo

hoangsonww / the-maze-game Goto Github PK

View Code? Open in Web Editor NEW
12.0 11.0 10.0 277 KB

๐Ÿฐ The Maze Game offers straightforward maze navigation challenges across multiple difficulty levels. It features responsive design for easy play on any device, including mobile, with intuitive on-screen controls for movement. Ideal for quick gaming sessions, providing both casual and challenging experiences.

Home Page: https://hoangsonww.github.io/The-Maze-Game/

License: MIT License

HTML 23.47% CSS 14.78% JavaScript 21.18% Python 40.57%
css3 game html5 javascript maze maze-algorithms maze-game maze-generation-algorithms maze-generator maze-solver pygame python mazes react

the-maze-game's Introduction

The Maze Game

A simple yet engaging maze game built by Son Nguyen in 2024 with DFS and Prim algorithms. Navigate through a dynamically generated maze to find the exit. Each time you play, a new maze is created, ensuring a unique experience. The game is designed to be lightweight and easy to play, making it suitable for all age groups.

However, creating it is a pain in the brain, so I hope you'll enjoy it! Star the repository if you like it and feel free to contribute to the project ๐ŸŒŸ.

Feel free to give it a try at The Maze Game!

Features

  • Randomized Maze Generation: Each game loads a new maze, thanks to the Depth-First Search (DFS) and Prim algorithms used for maze generation.
  • Player Navigation: Use the arrow keys to move up, down, left, or right within the maze.
  • Start and Exit Indicators: The game visually indicates the starting point and the exit. Reach the green block to win.
  • Regenerate Maze: A button allows players to generate a new maze at any time without reloading the page.
  • Responsive Design: The game canvas is responsive and adapts to different screen sizes, making it playable on both desktop and mobile devices.
  • On-Screen Controls: For mobile users, on-screen buttons are provided to navigate the player within the maze.

Game UI

Maze Game - Gameplay

Technologies Used

  • HTML: Structure of the game canvas and control elements.
  • CSS: Styling of the game canvas and alignment of game elements.
  • JavaScript: Game logic, including maze generation, player movement, collision detection, and UI interaction. Implemented using DFS and Prim algorithms.
  • Python: There is also a Python implementation of the maze generation algorithm using the Depth-First Search (DFS) algorithm.

Maze Generation Algorithm

The maze is generated using a randomized version of the Depth-First Search (DFS) & Prim algorithms. This algorithm starts at a random cell, marks it as part of the maze, and recursively explores unvisited neighbors, carving out a path. The process continues until all cells are visited, resulting in a perfect maze with a single solution.

Setup

  1. Clone the repository to your local machine.
  2. Open the index.html file in a modern web browser.
  3. Alternatively, you can run the Python implementation of the maze generation algorithm by executing the maze.py file.
python maze-gen.py

Before running the Python script, ensure that you have Python and Pygame installed on your machine.

pip install pygame

Usage

  • Navigate through the maze using the arrow keys or the on-screen controls buttons.
  • Click the Regenerate Maze button below the canvas to start a new game with a new maze layout.

Contribution

Feel free to fork the repository and submit pull requests to contribute to the game's development. Whether it's adding new features, improving the maze generation algorithm, or enhancing the game's UI/UX, all contributions are welcome.

License

This project is open-source and available under the MIT License. See the LICENSE file for more information.

Contact

You can reach out to me at [email protected] if you have any queries or feedback regarding the project.


Created with โค๏ธ in 2024 by Son Nguyen. Thank you for visiting and playing the game! ๐Ÿš€

the-maze-game's People

Contributors

hoangsonww avatar

Stargazers

John Feron avatar Uyen Nhat Vo avatar babi bibi rexhahahahaaaa avatar hehehehee avatar Waghib Ahmad avatar  avatar  avatar Jess avatar neyuahn avatar Hoang Minh avatar Kailie Le avatar  avatar

Watchers

 avatar  avatar Kailie Le avatar Hoang Minh avatar Jess avatar neyuahn avatar hehehehee avatar babi bibi rexhahahahaaaa avatar Uyen Nhat Vo avatar John Feron avatar Jinyi Li avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.