This project is a multi-threaded Pac-Man game implemented in C++ using the SFML library for graphics rendering. The game features Pac-Man, coins, power pellets, and enemy ghosts with specific behaviors.
- Introduction
- Features
- Installation
- Usage
- Files and Directories
- Game Controls
- Threading Details
- Credits
This project is a Pac-Man game where the player controls Pac-Man to collect coins and avoid enemy ghosts. The game uses multi-threading to handle different aspects such as enemy movement, collision detection, and rendering.
- Pac-Man character controlled by the player.
- Coins placed in the game arena to be collected by Pac-Man.
- Enemy ghosts that chase Pac-Man.
- Power pellets that grant temporary invincibility to Pac-Man.
- Multi-threaded architecture for handling game logic and rendering.
Follow the instructions on the SFML website to install SFML on your system.
WorUp Arrow- Move UpAorLeft Arrow- Move LeftSorDown Arrow- Move DownDorRight Arrow- Move RightEnter- Exit the game
- src/: Contains the source code files.
game.h: Contains game-related functions and definitions.enemy.h: Handles enemy behavior and collision detection.collision.h: Manages collision detection logic.menu.h: Menu-related functions and definitions.shared_variables.h: Shared variables used across the project.
- assets/: Contains image files for Pac-Man, ghosts, and other sprites.
- build/: Directory for build files and the executable.
WorUp Arrow: Move Pac-Man up.AorLeft Arrow: Move Pac-Man left.SorDown Arrow: Move Pac-Man down.DorRight Arrow: Move Pac-Man right.
Enter: Exit the game.
The game uses 12 threads:
- Main thread: Initializes the game and manages the main loop.
- Menu/User thread: Handles user input and menu operations.
- Game thread: Manages game logic and rendering.
- Enemy threads: Four threads, each managing the behavior of an individual ghost.
- Enemy/Pellet Collision threads: Four threads, each handling the collision detection between a specific ghost and power pellets.
- User/Power Collision thread: Handles collision detection between Pac-Man and power pellets.
This project was developed as part of a multi-threaded programming course. It uses the SFML library for graphics rendering. Special thanks to the course instructors and the SFML community for their support and resources.