{"id":19699988,"url":"https://github.com/anasbinrashid/multi-threaded-pacman-synchronization-glut-cpp","last_synced_at":"2025-10-28T16:17:27.828Z","repository":{"id":239777677,"uuid":"800541093","full_name":"anasbinrashid/Multi-Threaded-PACMAN-Synchronization-GLUT-CPP","owner":"anasbinrashid","description":"I made a Multi Threaded PACMAN in GLUT with complete Synchronization.","archived":false,"fork":false,"pushed_at":"2024-09-17T09:28:29.000Z","size":106,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-27T15:45:29.455Z","etag":null,"topics":["cplusplus","cpp","glut","glut-library","multithreading","pacman","pacman-game","project","synchronization","threads"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anasbinrashid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-14T14:29:01.000Z","updated_at":"2024-09-17T09:28:32.000Z","dependencies_parsed_at":"2024-05-16T03:51:49.959Z","dependency_job_id":"09178890-2698-417f-850f-ad0d5d269a95","html_url":"https://github.com/anasbinrashid/Multi-Threaded-PACMAN-Synchronization-GLUT-CPP","commit_stats":null,"previous_names":["anasbinrashid/multi-threaded-pacman-in-glut-with-synchronization","anasbinrashid/multi-threaded-pacman-synchronization-glut-cpp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anasbinrashid/Multi-Threaded-PACMAN-Synchronization-GLUT-CPP","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anasbinrashid%2FMulti-Threaded-PACMAN-Synchronization-GLUT-CPP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anasbinrashid%2FMulti-Threaded-PACMAN-Synchronization-GLUT-CPP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anasbinrashid%2FMulti-Threaded-PACMAN-Synchronization-GLUT-CPP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anasbinrashid%2FMulti-Threaded-PACMAN-Synchronization-GLUT-CPP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anasbinrashid","download_url":"https://codeload.github.com/anasbinrashid/Multi-Threaded-PACMAN-Synchronization-GLUT-CPP/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anasbinrashid%2FMulti-Threaded-PACMAN-Synchronization-GLUT-CPP/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267127887,"owners_count":24040148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-26T02:00:08.937Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cplusplus","cpp","glut","glut-library","multithreading","pacman","pacman-game","project","synchronization","threads"],"created_at":"2024-11-11T21:01:41.747Z","updated_at":"2025-10-28T16:17:22.769Z","avatar_url":"https://github.com/anasbinrashid.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Multi-Threaded PACMAN in GLUT with Synchronization\n\nWelcome to Multi-Threaded PAC-MAN in GLUT with Synchronization! This project aims to develop a multi-threaded version of the classic Pac-Man game using C/C++ and GLUT (OpenGL Utility Toolkit) graphics library, incorporating synchronization techniques to manage interactions between Pac-Man and multiple computer-simulated ghosts. The game ensures smooth gameplay with each entity operating on its own thread and proper synchronization to prevent data conflicts.\n\n## Project Objective\n\nThe objective of this project is to implement a multi-threaded Pac-Man game with the following phases:\n\n### Phase 1 - Setting up Dedicated Threads for Game Modules:\n- **Game Engine Thread**: Manages overall game flow, input handling, game state updating, and graphics rendering.\n- **User Interface Thread**: Manages UI components including menus, scoreboards, and HUD elements, and communicates player input to the game engine.\n- **Ghost Controller Threads**: Individual threads for each ghost controller, responsible for controlling ghost behavior independently.\n\n### Phase 2 - Basic Game Mechanics:\n- **Game Board Initialization**: Design layout for shared game board, including walls, paths, pellets, and power pellets. Initialize starting positions for Pac-Man and ghosts.\n- **Movement Mechanics**: Implement movement logic for Pac-Man and basic AI for ghost movement.\n- **Eating Mechanics**: Enable Pac-Man to eat pellets, update game score, and define effects of eating power pellets.\n- **Lives**: Implement a lives system for Pac-Man.\n\n### Phase 3 - Synchronization:\n- **Ghost Movement**: Ensure synchronization to prevent conflicts when ghosts read the game board while Pac-Man updates it.\n- **Eating Power Pellets**: Synchronize power pellet eating to prevent simultaneous consumption and ensure respawn consistency.\n- **Ghost House**: Manage resources (keys and exit permits) to prevent deadlock situations when ghosts leave the ghost house.\n- **Prioritizing Certain Ghosts**: Implement synchronization to ensure fair distribution of speed boosts among faster ghosts.\n\n## Implementation\n\n- **Separate Threads**: Pac-Man and each ghost operate on separate threads for independent movement.\n- **Proper Synchronization**: Use mutexes to ensure proper synchronization and prevent data conflicts.\n- **Concurrent Execution**: Implement concurrent execution allowing smooth movement of Pac-Man and ghosts without lag or jitter.\n- **Optimal Synchronization Solutions**: Choose appropriate synchronization solutions for each scenario to ensure optimal game performance and fairness.\n\n## Instructions\n\n- **Compilation**: Compile the code using a C compiler with proper linking to GLUT library.\n- **Execution**: Run the compiled executable to start the game.\n- **Controls**: Use arrow keys to control Pac-Man's movement.\n- **Gameplay**: Eat pellets, avoid ghosts, and complete levels to win.\n\n## Contributions\n\nContributions to enhance the game mechanics, optimize synchronization, or improve overall gameplay experience are welcome! Please follow project guidelines and submit pull requests with your changes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanasbinrashid%2Fmulti-threaded-pacman-synchronization-glut-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanasbinrashid%2Fmulti-threaded-pacman-synchronization-glut-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanasbinrashid%2Fmulti-threaded-pacman-synchronization-glut-cpp/lists"}