This README provides an overview of a Java-based Pacman game, featuring dynamic level loading, collision detection, and classic Pacman gameplay mechanics.
This Java implementation of the classic game Pacman allows players to control Pacman, navigate through mazes, eat dots, and avoid ghosts.
- Processing: A flexible software sketchbook and a language for learning how to code within the context of the visual arts. Processing Website
- JUnit 5: JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks. JUnit 5 Website
- Download the Source Code: Download the source code from the GitHub repository
- Open the Project: Open the project in your favorite IDE (e.g. IntelliJ, Eclipse, etc.)
- Run the Game: Run the game by running the
Main.java
file in thesrc
folder. - Play the Game: Play the game by using the game controls listed below.
- W: Move forward.
- A: Move left.
- S: Move backward.
- D: Move right.
- R: Restart the game.
Test the Pacman model in JShell as follows:
-
Start JShell: Open JShell in your terminal.
-
Load the Pacman Model:
- path: out/production/Pacman
- put it in the classpath (path/to/your/classes).
jshell --class-path path/to/your/classes jshell> import Pacman.model.*; // Make sure this is correct and the classes are in the classpath
- Create an Instance:
jshell> PacmanModel model = new PacmanModel(800, 600); // Create an instance of PacmanModel
- Simulate Game Actions:
- Move Pacman:
jshell> model.movePacman('w'); // Simulate moving Pacman up
- Update Game State:
jshell> model.updateGame(); // Update the game state
- Move Pacman:
- Check Game Status:
jshell> model.isGameOver(); // Returns true if the game is over
Note: JShell tests individual components/methods and won't run the game with graphical elements.
- This project was created by [Taha Hussein].
- This project was created for [CS1016 Programmierung interaktiver Systeme] at [THM University] Under the supervision of Prof. Dr. Weigel.
- This project was created in the winter semester of 2023/24.