{"id":29091180,"url":"https://github.com/ermug/tetris_redux","last_synced_at":"2025-06-28T06:05:47.769Z","repository":{"id":300867184,"uuid":"1007422245","full_name":"ermug/Tetris_Redux","owner":"ermug","description":"Complete Tetris Recreation written in C++ with SFML. All 7 pieces, smooth controls, progressive difficulty, scoring system. Cross-platform with Windows releases.","archived":false,"fork":false,"pushed_at":"2025-06-24T01:34:00.000Z","size":9430,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-24T02:33:44.513Z","etag":null,"topics":["2d-game","cpp","game-development","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/ermug.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":"2025-06-24T01:22:54.000Z","updated_at":"2025-06-24T02:04:23.000Z","dependencies_parsed_at":"2025-06-24T02:44:54.132Z","dependency_job_id":null,"html_url":"https://github.com/ermug/Tetris_Redux","commit_stats":null,"previous_names":["ermug/tetris_redux"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ermug/Tetris_Redux","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ermug%2FTetris_Redux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ermug%2FTetris_Redux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ermug%2FTetris_Redux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ermug%2FTetris_Redux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ermug","download_url":"https://codeload.github.com/ermug/Tetris_Redux/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ermug%2FTetris_Redux/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262382732,"owners_count":23302296,"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":["2d-game","cpp","game-development","sfml","tetris"],"created_at":"2025-06-28T06:05:46.735Z","updated_at":"2025-06-28T06:05:47.758Z","avatar_url":"https://github.com/ermug.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎮 Tetris Game\r\n\r\nA complete, feature-rich implementation of the classic Tetris game built with C++ and SFML. Experience smooth gameplay, vibrant graphics, and all the nostalgic fun of the original Tetris!\r\n\r\n![Tetris Screenshot](https://img.shields.io/badge/Game-Tetris-blue?style=for-the-badge\u0026logo=game\u0026logoColor=white)\r\n![C++](https://img.shields.io/badge/C%2B%2B-17-blue?style=for-the-badge\u0026logo=cplusplus)\r\n![SFML](https://img.shields.io/badge/SFML-2.5+-green?style=for-the-badge)\r\n\r\n## 🚀 Quick Start\r\n\r\n### 💾 Download \u0026 Play (Recommended)\r\n\r\n**Want to play immediately? No setup required!**\r\n\r\n1. **📦 [Download Latest Release](../../releases/latest)**\r\n2. **📂 Extract the zip file**\r\n3. **🎮 Run `tetris.exe` and enjoy!**\r\n\r\n\u003e ✨ **Windows users**: The release package includes everything you need - no SFML installation or font setup required!\r\n\r\n### 🛠️ Or Build From Source\r\n\r\nIf you want to modify the game or build for other platforms, see the [Installation](#-installation) section below.\r\n\r\n## ✨ Features\r\n\r\n- 🎯 **Complete Tetris Experience** - All 7 standard Tetrimino pieces (I, O, T, S, Z, J, L)\r\n- 🎨 **Colorful Graphics** - Each piece type has its distinctive color\r\n- ⚡ **Smooth Controls** - Responsive keyboard input with no lag\r\n- 🔄 **Piece Rotation** - Full 90-degree clockwise rotation with wall kicks\r\n- 💥 **Line Clearing** - Satisfying line clear animations and scoring\r\n- 📈 **Progressive Difficulty** - Game speed increases with level progression\r\n- 🏆 **Scoring System** - Points for drops, line clears, and level bonuses\r\n- 🎮 **Game Over \u0026 Restart** - Clean game over detection with instant restart\r\n- 🎵 **Clean UI** - Score, level, and status display\r\n\r\n## 🎮 Controls\r\n\r\n| Key | Action | Points |\r\n|-----|--------|--------|\r\n| **←** / **→** | Move piece left/right | - |\r\n| **↓** | Soft drop (faster fall) | +1 per drop |\r\n| **↑** | Rotate piece clockwise | - |\r\n| **Space** | Hard drop (instant drop) | +2 per row |\r\n| **R** | Restart game (when game over) | - |\r\n| **ESC** | Close game | - |\r\n\r\n## 🏗️ Project Structure\r\n\r\n```\r\ntetris/\r\n├── 📄 Tetris.h              # Class declaration and interface\r\n├── 🔧 Tetris.cpp            # Core game implementation\r\n├── 🚀 main.cpp              # Application entry point\r\n├── ⚙️ Makefile              # Build automation\r\n├── 📖 README.md             # This documentation\r\n├── 📁 fonts/                # Font files directory (Optional, not included, must create manually)\r\n│   └── arial.ttf            # Place your font file here\r\n```\r\n\r\n## 📥 Installation\r\n\r\n\u003e 💡 **Just want to play?** Skip this section and [download the release](#-download--play-recommended) instead!\r\n\r\n### Prerequisites for Building\r\n\r\n- **C++ Compiler**: Supporting C++17 standard (GCC 7.0+ / Clang 5.0+ / MSVC 2017+)\r\n- **SFML Library**: Version 2.5 or newer\r\n- **Font File**: Any TrueType font (.ttf) - see [Font Setup](#-font-setup)\r\n\r\n### 🐧 Ubuntu/Debian\r\n```bash\r\n# Install dependencies\r\nsudo apt-get update\r\nsudo apt-get install build-essential libsfml-dev\r\n\r\n# Clone and build\r\ngit clone \u003cyour-repo-url\u003e\r\ncd tetris\r\nmake\r\n```\r\n\r\n### 🍎 macOS\r\n```bash\r\n# Install dependencies (requires Homebrew)\r\nbrew install sfml\r\n\r\n# Clone and build\r\ngit clone \u003cyour-repo-url\u003e\r\ncd tetris\r\nmake\r\n```\r\n\r\n### 🪟 Windows\r\n\r\n\u003e **🎯 Prefer the easy way?** [Download the pre-built release](#-download--play-recommended) - no setup needed!\r\n\r\n#### Option 1: Visual Studio\r\n1. Download SFML from [sfml-dev.org](https://www.sfml-dev.org/download.php)\r\n2. Extract SFML to `C:\\SFML`\r\n3. Create new C++ project in Visual Studio\r\n4. Add source files to project\r\n5. Configure project properties:\r\n   - **C/C++ → General → Additional Include Directories**: `C:\\SFML\\include`\r\n   - **Linker → General → Additional Library Directories**: `C:\\SFML\\lib`\r\n   - **Linker → Input → Additional Dependencies**: Add:\r\n     ```\r\n     sfml-graphics.lib\r\n     sfml-window.lib\r\n     sfml-system.lib\r\n     ```\r\n\r\n#### Option 2: MinGW/MSYS2\r\n```bash\r\n# Install SFML through MSYS2\r\npacman -S mingw-w64-x86_64-sfml\r\n\r\n# Compile manually\r\ng++ -std=c++17 main.cpp Tetris.cpp -o tetris.exe -lsfml-graphics -lsfml-window -lsfml-system\r\n```\r\n\r\n## 🔧 Building\r\n\r\n### Using Makefile (Recommended for Linux/macOS)\r\n```bash\r\n# Build the game\r\nmake\r\n\r\n# Build and run immediately\r\nmake run\r\n\r\n# Build with debug symbols\r\nmake debug\r\n\r\n# Clean build files\r\nmake clean\r\n\r\n# Show all available commands\r\nmake help\r\n```\r\n\r\n### Manual Compilation\r\n```bash\r\n# Standard build\r\ng++ -std=c++17 -Wall -Wextra -O2 main.cpp Tetris.cpp -o tetris -lsfml-graphics -lsfml-window -lsfml-system\r\n\r\n# Debug build\r\ng++ -std=c++17 -g -DDEBUG main.cpp Tetris.cpp -o tetris -lsfml-graphics -lsfml-window -lsfml-system\r\n\r\n# Run\r\n./tetris\r\n```\r\n\r\n## 🎨 Font Setup\r\n\r\n\u003e **📦 Using the release version?** Fonts are already included - skip this section!\r\n\r\nThe game requires a TrueType font for text display. If you see font loading warnings:\r\n\r\n### Quick Setup (Choose One):\r\n\r\n1. **Download Free Font**:\r\n   - Visit [Google Fonts](https://fonts.google.com/)\r\n   - Download \"Roboto\" or \"Open Sans\"\r\n   - Rename the `.ttf` file to `arial.ttf`\r\n   - Place in game directory\r\n\r\n2. **Use System Font**:\r\n   ```bash\r\n   # Linux\r\n   cp /usr/share/fonts/truetype/dejavu/DejaVuSans.ttf ./arial.ttf\r\n   \r\n   # macOS\r\n   cp /System/Library/Fonts/Arial.ttf ./arial.ttf\r\n   \r\n   # Windows (Command Prompt)\r\n   copy \"C:\\Windows\\Fonts\\arial.ttf\" .\\arial.ttf\r\n   ```\r\n\r\n3. **Create Fonts Directory**:\r\n   ```bash\r\n   mkdir fonts\r\n   # Place any .ttf font in fonts/arial.ttf\r\n   ```\r\n\r\n### Automatic Detection\r\nThe game searches these locations automatically:\r\n- `./arial.ttf`\r\n- `./fonts/arial.ttf`\r\n- `./assets/fonts/arial.ttf`\r\n- System font directories\r\n\r\n## 🎯 Game Rules \u0026 Scoring\r\n\r\n### Objective\r\nClear horizontal lines by completely filling them with Tetrimino blocks.\r\n\r\n### Scoring System\r\n- **Soft Drop** (↓): +1 point per row\r\n- **Hard Drop** (Space): +2 points per row\r\n- **Line Clear**: 100 × Level × Lines cleared simultaneously\r\n  - Single: 100 × Level\r\n  - Double: 200 × Level  \r\n  - Triple: 300 × Level\r\n  - Tetris: 400 × Level\r\n\r\n### Level Progression\r\n- **Level increases** every 10 lines cleared\r\n- **Speed increases** with each level\r\n- **Drop interval** decreases: 500ms - (Level-1) × 50ms\r\n- **Minimum speed**: 50ms between drops\r\n\r\n### Game Over\r\n- Occurs when new pieces cannot spawn (board is full)\r\n- Press **R** to restart immediately\r\n- All progress resets to Level 1\r\n\r\n## 🚀 Running the Game\r\n\r\n### From Release (Windows)\r\n```bash\r\n# After downloading and extracting\r\ntetris.exe\r\n```\r\n\r\n### From Source Build\r\n```bash\r\n# After building\r\n./tetris\r\n\r\n# Or with make\r\nmake run\r\n```\r\n\r\n### First Launch Checklist:\r\n- ✅ Download from [Releases](../../releases/latest) (easiest), or\r\n- ✅ SFML libraries installed (if building from source)\r\n- ✅ Font file available (arial.ttf) (if building from source)\r\n- ✅ Executable has proper permissions\r\n- ✅ Terminal/console for error messages\r\n\r\n## 🐛 Troubleshooting\r\n\r\n### For Release Users\r\n\r\n**\"Windows Defender / Antivirus blocks the file\"**\r\n- This is normal for unsigned executables\r\n- Add the folder to your antivirus exceptions\r\n- Or right-click → Properties → \"Unblock\" checkbox\r\n\r\n**\"MSVCP140.dll missing\" or similar**\r\n- Install [Microsoft Visual C++ Redistributable](https://aka.ms/vs/17/release/vc_redist.x64.exe)\r\n- Both x86 and x64 versions may be needed\r\n\r\n### For Source Build Users\r\n\r\n**\"Command not found\" / \"File not found\"**\r\n```bash\r\n# Make executable (Linux/macOS)\r\nchmod +x tetris\r\n\r\n# Check if file exists\r\nls -la tetris\r\n```\r\n\r\n**\"SFML libraries not found\"**\r\n```bash\r\n# Check SFML installation\r\npkg-config --libs sfml-all\r\n\r\n# Install SFML (Ubuntu)\r\nsudo apt-get install libsfml-dev\r\n```\r\n\r\n**\"Font loading warning\"**\r\n- Follow the [Font Setup](#-font-setup) section\r\n- Game will work but text may be invisible without fonts\r\n\r\n**Game runs but no graphics appear**\r\n- Check graphics drivers\r\n- Try running in compatibility mode\r\n- Verify SFML installation\r\n\r\n**Compilation errors**\r\n```bash\r\n# Check compiler version\r\ng++ --version  # Should be 7.0+\r\n\r\n# Verify C++17 support\r\ng++ -std=c++17 --version\r\n```\r\n\r\n## 🎮 Gameplay Tips\r\n\r\n- **Plan Ahead**: Look at upcoming pieces and plan placement\r\n- **Create Tetrises**: Save the I-piece for 4-line clears when possible\r\n- **Avoid Holes**: Don't trap empty spaces under blocks\r\n- **Use Hard Drop**: Space bar for quick placement and extra points\r\n- **Master Rotation**: Learn piece rotation patterns for tight spaces\r\n- **Speed Practice**: Start slow and gradually increase difficulty\r\n\r\n## 🔧 Customization\r\n\r\n### Piece Colors\r\nEdit the `colors` vector in `Tetris.cpp`:\r\n```cpp\r\ncolors = {\r\n    sf::Color::Black,           // 0 - Empty\r\n    sf::Color::Cyan,            // 1 - I piece (straight)\r\n    sf::Color::Yellow,          // 2 - O piece (square)\r\n    sf::Color::Magenta,         // 3 - T piece\r\n    sf::Color::Green,           // 4 - S piece\r\n    sf::Color::Red,             // 5 - Z piece\r\n    sf::Color::Blue,            // 6 - J piece\r\n    sf::Color(255,165,0)        // 7 - L piece (orange)\r\n};\r\n```\r\n\r\n### Game Difficulty\r\nModify timing in the constructor:\r\n```cpp\r\ndropInterval = 500.0f;  // Starting speed (milliseconds)\r\n```\r\n\r\n### Board Size\r\nChange constants in `Tetris.h`:\r\n```cpp\r\nstatic const int BOARD_WIDTH = 10;   // Standard: 10\r\nstatic const int BOARD_HEIGHT = 20;  // Standard: 20\r\n```\r\n\r\n### Development Setup\r\n```bash\r\n# Fork the repository\r\ngit clone \u003cyour-fork\u003e\r\ncd tetris\r\n\r\n# Create feature branch\r\ngit checkout -b feature/amazing-feature\r\n\r\n# Make changes and test\r\nmake debug\r\n./tetris\r\n\r\n# Commit and push changes\r\ngit commit -m \"Add amazing feature\"\r\ngit push origin feature/amazing-feature\r\n```\r\n\r\n## 📝 Code Architecture\r\n\r\n### Class Design\r\n```cpp\r\nclass Tetris {\r\n    // Game state management\r\n    // Input handling\r\n    // Collision detection\r\n    // Rendering system\r\n    // Scoring logic\r\n};\r\n```\r\n\r\n### Key Methods\r\n- **`spawnNewPiece()`**: Piece generation and placement\r\n- **`isValidPosition()`**: Collision detection system\r\n- **`rotatePiece()`**: Matrix rotation with boundary checking\r\n- **`clearLines()`**: Line detection and removal logic\r\n- **`handleInput()`**: Real-time input processing\r\n- **`update()`**: Game state updates and timing\r\n- **`render()`**: Graphics rendering pipeline\r\n\r\n## 📦 Release Notes\r\n\r\n### Latest Release Features\r\n- ✅ **Added Sound Effects**: Now 50% Less Boring!\r\n- ✅ **No Installation Required**: Just download and play!\r\n- ✅ **All Dependencies Included**: SFML libraries bundled\r\n- ✅ **Font Included**: No need to find arial.ttf\r\n- ✅ **Windows Compatible**: Tested on Windows 10/11\r\n- ✅ **Portable**: Run from any folder, no installation needed\r\n\r\n*Check the [Releases page](../../releases) for version history and changelog.*\r\n\r\n## 📄 License\r\n\r\nThis project is open source and available under the [MIT License](LICENSE).\r\n\r\n## 🙏 Acknowledgments\r\n\r\n- **SFML Team** - For the excellent multimedia library\r\n- **Tetris Company** - For creating the timeless original game\r\n\r\n---\r\n\r\n**Happy Gaming! 🎮✨**\r\n\r\n*Built with ❤️ using C++ and SFML*\r\n\r\n**🎯 [Download Now](../../releases/latest) | 🛠️ Build From Source | 🐛 Report Issues**\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fermug%2Ftetris_redux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fermug%2Ftetris_redux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fermug%2Ftetris_redux/lists"}