{"id":19225166,"url":"https://github.com/rafali25/snake_game","last_synced_at":"2025-10-12T15:42:30.122Z","repository":{"id":261820500,"uuid":"885443923","full_name":"rafali25/snake_game","owner":"rafali25","description":"This is a simple snake game in C++ which includes multithreading","archived":false,"fork":false,"pushed_at":"2024-11-14T02:27:47.000Z","size":1682,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-11T15:32:40.405Z","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,"zenodo":null}},"created_at":"2024-11-08T15:41:59.000Z","updated_at":"2024-11-14T02:27:50.000Z","dependencies_parsed_at":"2024-11-08T16:42:15.343Z","dependency_job_id":"456d0715-fbab-457e-90b4-253b41f3cf09","html_url":"https://github.com/rafali25/snake_game","commit_stats":null,"previous_names":["rafali25/snake_game"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rafali25/snake_game","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafali25%2Fsnake_game","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafali25%2Fsnake_game/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafali25%2Fsnake_game/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafali25%2Fsnake_game/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rafali25","download_url":"https://codeload.github.com/rafali25/snake_game/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafali25%2Fsnake_game/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279011856,"owners_count":26085005,"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-10-12T02:00:06.719Z","response_time":53,"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":["cpp","multithreading"],"created_at":"2024-11-09T15:14:11.758Z","updated_at":"2025-10-12T15:42:30.088Z","avatar_url":"https://github.com/rafali25.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Snake Game 🐍\n\nA classic Snake game implemented in C++ with **multithreading** for enhanced gameplay. This simple console game is fun to play and demonstrates essential programming concepts like game loops, input handling, and multithreading.\n\n## Features\n- **Classic Gameplay**: Control the snake, eat fruits, grow longer, and increase your score.\n- **Multithreading**: The game utilizes a separate thread to handle background music or sound effects.\n- **Wrap-around Walls**: The snake can pass through one wall and reappear on the opposite side.\n- **Expandable Snake**: Each fruit the snake consumes will increase its length.\n- **Simple Controls**: \n  - **`W`** - Move Up\n  - **`S`** - Move Down\n  - **`A`** - Move Left\n  - **`D`** - Move Right\n  - **`X`** - Exit Game\n\n## How It Works\nThis Snake game is built in C++ and uses **multithreading** to play background sounds without interrupting gameplay. The main game loop handles the rendering, user input, and game logic in sequence, while a separate thread plays sounds to enhance the user experience.\n\n### Multithreading Example\nThe `threaded()` function, which plays a sound, is run in a separate thread so it doesn’t block the main game loop:\n```cpp\nvoid threaded(){\n    PlaySound(TEXT(\"JOLA.wav\"), NULL, SND_SYNC);\n}\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafali25%2Fsnake_game","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafali25%2Fsnake_game","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafali25%2Fsnake_game/lists"}