A desktop maze game built in Java using Swing, where a robot (styled as Pacman) autonomously navigates a generated grid. The robot explores walkable paths to reach the endpoint, updating visuals and direction dynamically, with interactive panels guiding the user through gameplay.
- Language: Java (Java Swing GUI)
- Grid Size Options: 5, 8, 10
- Core Components:
IntroPanel: Start screen with map size selectionMapPanel: Main gameplay view with tile updates and robot movementEndPanel: Displays results and play-again option
- Robot Behavior:
- Moves using available walkable tiles
- Avoids previously visited tiles unless backtracking
- Dynamically updates facing direction using visual cues
- Visual Feedback:
- Tile state transitions: unknown โ shown โ walked-on
- Pacman orientation updates based on direction (
PacU,PacD, etc.)
- File Features:
- Saves run data to
Results.txt - Displays game summary in scrollable view on completion
- Saves run data to
Select your maze size and start the game:

Pacman explores the maze, changing direction and stepping over tiles.
demo_video.mp4
- Java Development Kit (JDK 8 or higher)
- A system with a properly installed Java Virtual Machine (JVM)
You can run the project in one of the following ways:
-
Using an IDE (IntelliJ, Eclipse, VS Code):
- Open the project.
- Set
Main.javaas the entry point. - Run the program from the IDE.
-
Compiling and Running Locally:
- Compile all Java source files using
javac. - Run the game using the
javacommand withMainas the entry class.
- Compile all Java source files using
-
Packaging as an Executable JAR:
- Compile the project.
- Package it using
jarwithMainas the entry point. - Run the JAR using
java -jar.