Skip to content

lphan48/MazeGame

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Maze Game

Completed Spring 2023

About The Project

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.

Dependences

This project supports Java class file versions 61.0 or higher.

Installation

  1. Clone the repo:
    git clone https://github.com/lphan48/MazeGame
  2. Navigate to project directory:
    cd MazeGame
  3. Run the game by executing the main JAR file, located in the project's root directory:
    java -jar MazeGame.jar

Usage

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):

Screenshot 2023-09-07 at 11 54 05 AM

Once the maze is fully generated, the user can select one of the three ways to solve the maze:

Screenshot 2023-09-07 at 11 54 21 AM

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:

Screenshot 2023-09-07 at 11 54 40 AM Screenshot 2023-09-07 at 11 55 04 AM

Selecting 'Manual' will allow the player to solve the maze individually:

Screenshot 2023-09-07 at 11 56 48 AM

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

Screenshot 2023-09-07 at 11 54 21 AM

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages