This project utilizes Kruskal's algorithm to generate random mazes that can be played either manually by the user, or automatically using depth first and breadth first algorithms. The game tracks user movement and displays the shortest possible path upon completion.
This project supports Java class file versions 61.0 or higher.
- Clone the repo:
git clone https://github.com/lphan48/MazeGame
- Navigate to project directory:
cd MazeGame
- Run the game by executing the main JAR file, located in the project's root directory:
java -jar MazeGame.jar
The game begins by animating the generation of a random maze using Kruskal's MST Algorithm, where each wall in the grid disappears one by one (screenshot captured in the middle of generation):


Selecting 'DFS' (depth first) or 'BFS' (breadth first) will animate the maze solving using the selected algorithm. Once the maze is solved, the game will highlight the quickest possible path:



After completion, clicking anywhere on the board will restart the game and create a new randomly generated maze:
