This project is a multi-threaded version of the classic Pac-Man game developed in C using OPENGL. It utilizes synchronization techniques core concepts of operating systems, to manage interactions between Pac-Man and multiple computer-simulated ghosts. The game features a game engine thread, a user interface thread, and individual threads for each ghost controller.
- Game Engine Thread: Handles game flow, input, game state updates, and rendering.
- User Interface Thread: Manages UI components, menus, and player input events.
- Ghost Controller Threads: Individual threads for each ghost to control their behavior.
To compile the game, use the following command:
gcc -o pacman_game game.c main.c texture.c menu.c -lGL -lGLU -lglut -lm -lSOIL -lpthread -lm `sdl2-config --cflags --libs` -lSDL2_mixer
Make sure to download the SOIL library from GitHub and install SDL2 and SDL properly before compiling.
On Ubuntu, you can install SDL2 and SDL using the following commands:
sudo apt-get update
sudo apt-get install libsdl2-dev
sudo apt-get install libsdl2-mixer-dev
- The game may contain bugs, and some features like tracking of ghosts are not fully implemented but have function definitions available (commented out).
- Extra files for additional features are included in the project.
Contributions to solve bugs and improve the game are welcome!
