{"id":19225180,"url":"https://github.com/rafali25/car_game","last_synced_at":"2026-06-21T00:35:40.164Z","repository":{"id":261824985,"uuid":"885454896","full_name":"rafali25/car_game","owner":"rafali25","description":"A simple Car game in cpp using multithreading to play background music","archived":false,"fork":false,"pushed_at":"2024-11-14T02:31:39.000Z","size":14502,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-04T21:28:11.066Z","etag":null,"topics":["cpp","multithreading"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rafali25.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-11-08T16:06:22.000Z","updated_at":"2024-11-14T02:31:42.000Z","dependencies_parsed_at":"2024-11-08T17:32:54.696Z","dependency_job_id":null,"html_url":"https://github.com/rafali25/car_game","commit_stats":null,"previous_names":["rafali25/car_game"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafali25%2Fcar_game","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafali25%2Fcar_game/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafali25%2Fcar_game/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafali25%2Fcar_game/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rafali25","download_url":"https://codeload.github.com/rafali25/car_game/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240298489,"owners_count":19779283,"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","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":["cpp","multithreading"],"created_at":"2024-11-09T15:14:13.421Z","updated_at":"2026-06-21T00:35:40.158Z","avatar_url":"https://github.com/rafali25.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Car Game 🚗\n\nA console-based Car Game implemented in C++ that utilizes **multithreading** to enhance gameplay by playing background music and handling other tasks simultaneously.\n\n## Project Structure\nThis project includes the following files:\n- **main.cpp**: Contains the main game logic, including movement, scoring, and collision detection.\n- **CarG.h**: The header file defining the `CarG` class and its methods, including multithreaded functionality.\n- **CarG.exe**: The compiled executable for running the game.\n- **123.wav**\n- **all.wav**\n## Features\n- **Player-Controlled Car**: Navigate left and right on the road to avoid obstacles.\n- **Enemy Cars and Cash Collection**: Dodge enemy cars and collect cash symbols (`$`) for points.\n- **Dynamic Difficulty**: As points increase, the game speed accelerates, adding to the challenge.\n- **Multithreading for Background Music**: A separate thread plays background music while the game runs smoothly.\n- **Simple Controls**:\n  - **`A`** or **`a`** - Move Left\n  - **`D`** or **`d`** - Move Right\n  - **`Q`** or **`q`** - Quit the game\n\n## Multithreading Feature\nThe game uses multithreading to play background music continuously during gameplay. The `music` function is run in a separate thread to ensure that sound playback does not interfere with the main game loop.\n\nIn **CarG.h**, the `music` function is defined to play sound files:\n```cpp\nvoid music() {\n    PlaySound(TEXT(\"123.wav\"), NULL, SND_SYNC);\n    PlaySound(TEXT(\"all.wav\"), NULL, SND_SYNC);\n}\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafali25%2Fcar_game","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafali25%2Fcar_game","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafali25%2Fcar_game/lists"}