{"id":21897938,"url":"https://github.com/abhishek-k-git/tetris","last_synced_at":"2025-09-16T17:45:19.423Z","repository":{"id":239704675,"uuid":"800316856","full_name":"Abhishek-k-git/Tetris","owner":"Abhishek-k-git","description":"This project is a classic Tetris game implemented in C++ using the SFML framework. It provides players with an engaging and nostalgic experience, allowing them to test their skills in clearing lines of falling Tetriminos.","archived":false,"fork":false,"pushed_at":"2024-05-14T05:43:36.000Z","size":281,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-20T02:49:37.765Z","etag":null,"topics":["cpp","game","oop","sfml","tetris"],"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/Abhishek-k-git.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-05-14T05:29:01.000Z","updated_at":"2024-05-14T05:43:40.000Z","dependencies_parsed_at":"2024-05-14T06:44:05.676Z","dependency_job_id":null,"html_url":"https://github.com/Abhishek-k-git/Tetris","commit_stats":null,"previous_names":["abhishek-k-git/tetris"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Abhishek-k-git/Tetris","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhishek-k-git%2FTetris","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhishek-k-git%2FTetris/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhishek-k-git%2FTetris/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhishek-k-git%2FTetris/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Abhishek-k-git","download_url":"https://codeload.github.com/Abhishek-k-git/Tetris/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Abhishek-k-git%2FTetris/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275457688,"owners_count":25468239,"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-09-16T02:00:10.229Z","response_time":65,"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","game","oop","sfml","tetris"],"created_at":"2024-11-28T14:21:34.797Z","updated_at":"2025-09-16T17:45:19.402Z","avatar_url":"https://github.com/Abhishek-k-git.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Tetris in C++ with SFML\n\nThis repository contains the source code for a classic Tetris game developed in C++ using the Simple and Fast Multimedia Library (SFML). The game implements core Tetris mechanics like falling Tetriminos, line clearing, scorekeeping, and a user-friendly interface.\n\n\u003c!-- \u003cimg width=\"30%\" src=\"/tetris.png\" alt=\"\"\u003e\n\u003cimg width=\"30%\" src=\"/tetris_game.png\" alt=\"\"\u003e--\u003e\n\n| ![tetris](./tetris.png) | ![tetris](./tetris_game.png) |\n|---|---|\n\n\n#### Features\n\nTraditional Tetris gameplay with random Tetrimino generation\nLine clearing with scoring system\nGame over state detection\nOptional background music and sound effects\nScore tracking with a high score file (maxScore.txt)\n\n#### Project Setup\n\nPrerequisites\nC++ Compiler: A C++ compiler like GCC or Clang is required to compile the source code. If you don't have one, you can download and install a suitable compiler from the internet.\nSFML: Download and install the latest stable version of SFML (https://www.sfml-dev.org/download.php). Make sure to follow the installation instructions for your operating system.\n\n##### Visual Studio Setup (Optional)\n\nCreate a new project in Visual Studio. Choose \"Empty Project\" under C++/Win32.\nAdd existing items to the project:\nAll source code files (.cpp and .hpp)\nResource files (.ogg, .ttf, .txt)\nMakefile (if you prefer using it)\nConfigure project properties:\nUnder \"VC++ Directories\", add the path to SFML's include directory (#include \u003cSFML/...\u003e) in the \"Include Directories\" property.\nUnder \"Linker\", add the path to SFML's library directory (-L\u003cpath/to/sfml-libs\u003e) in the \"Additional Library Directories\" property.\nAdd the SFML libraries to the \"Additional Dependencies\" property.\n\n```bash\nsfml-graphics-d.lib\nsfml-window-d.lib\nsfml-audio-d.lib\nsfml-network-d.lib\nsfml-system-d.lib\n```\n\n##### Using a Makefile (Recommended)\n\nEnsure you have a make utility installed (usually available on Linux and macOS).\n\nThe provided Makefile automates compilation and linking:\n\nCode snippet\n\n```bash\nall:\n\tg++ -Wall main.cpp Board.cpp Pieces.cpp UI.cpp Sounds.cpp -lsfml-system -lsfml-window -lsfml-graphics -lsfml-audio -o game\n```\n\nRun make in your terminal from the project directory to compile the game.\n\n#### Running the Game\n\nAfter successful compilation, execute the generated executable (e.g., tetris.exe on Windows) to start the game.\n\n#### Gameplay Controls\n\nUse the arrow keys to move the falling Tetrimino left, right, and down.\nPress the up arrow key to rotate the Tetrimino. (Note: Rotation may be restricted in certain positions to maintain game rules.)\nPress the spacebar (optional) to drop the Tetrimino immediately.\nThe game ends when a Tetrimino cannot be placed without overlapping existing blocks.\n\n#### Customization\n\nYou can adjust the gameplay difficulty, sound effects, and background music by modifying relevant code in the source files.\nThe maxScore.txt file stores the highest score achieved. You can reset it manually if desired.\n\n#### Project Structure\n\nThe project is organized into several files with well-defined responsibilities:\n\n- **Board.cpp and Board.hpp:** Implement the game board logic, including grid management, line clearing, and scoring.\n- **gameOver.ogg, line.ogg, music.ogg, newScore.ogg, and sounds.ogg:** Optional sound effects and background music for a more immersive gameplay experience.\n- **ka1.ttf (Karmatic Arcade font):** Font file used for displaying the score and other UI elements.\n- **main.cpp:** The entry point of the program, where all game components are initialized, the game loop is managed, and user input is handled.\n- **Makefile** (optional): Automated build script for compilation and linking.\n- **maxScore.txt:** Stores the highest achieved score.\n- **Pieces.cpp and Pieces.hpp:** Responsible for creating and rotating falling pieces also called tetriminous.\n- **Sounds.cpp and Sounds.hpp:** For integrating sound into the game.\n- **UI.cpp and UI.hpp:** For visual or ui.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhishek-k-git%2Ftetris","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabhishek-k-git%2Ftetris","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabhishek-k-git%2Ftetris/lists"}