A 2D falling block puzzle game for Android built with Kotlin and Jetpack Compose.
- Classic Gameplay: T-piece tetromino falling and rotating mechanics
- Responsive Design: Adapts to different Android screen sizes
- Portrait Mode: Optimized for vertical gameplay
- Touch Controls: Intuitive button-based controls
- Score System: Points for clearing lines with level progression
- Game Over Handling: Restart functionality when pieces reach the top
- ← (Left Arrow): Move piece left
- → (Right Arrow): Move piece right
- ↻ (Rotate): Rotate piece 90° clockwise
- ↓ (Drop): Soft drop (rapid falling)
- Language: Kotlin
- UI Framework: Jetpack Compose
- Architecture: MVVM with ViewModel
- Minimum SDK: API 24 (Android 7.0)
- Target SDK: API 34 (Android 14)
app/src/main/java/com/quantumblocks/game/
├── model/ # Data models (GameState, Piece, Position)
├── engine/ # Game logic and mechanics
├── viewmodel/ # ViewModel for state management
├── ui/
│ ├── components/ # Reusable UI components
│ ├── screens/ # Main game screen
│ └── theme/ # App theming
└── MainActivity.kt # Main activity entry point
Position: 2D grid coordinatesPiece: Tetromino with rotation and movement logicGameState: Complete game state including board, score, and level
GameEngine: Handles game logic, collision detection, and piece movement- Automatic falling with speed progression
- Line clearing and scoring system
- Game over detection
GameBoard: Canvas-based game grid renderingControlPanel: Touch controls for piece manipulationScoreDisplay: Current score and level displayGameOverDialog: End game dialog with restart option
-
Prerequisites:
- Android Studio Arctic Fox or later
- Android SDK API 24+
- Java 8 or later
-
Build the project:
./gradlew build
-
Install on device:
./gradlew installDebug
-
Run in Android Studio:
- Open the project in Android Studio
- Connect an Android device or start an emulator
- Click the "Run" button
- Pieces spawn at the top center of the board
- Automatic downward movement at constant speed
- Manual left/right movement with button controls
- Rotation with 90° clockwise turns
- Soft drop for rapid falling
- Complete horizontal rows disappear
- Blocks above fall down to fill gaps
- Score increases based on lines cleared and current level
- Level increases every 1000 points
- Occurs when a new piece cannot be placed at the top
- Displays final score and level reached
- Restart option to begin a new game
This is the MVP (Minimum Viable Product) version. Future iterations will include:
- Multiple Piece Shapes: All 7 standard tetrominoes
- Material Types: Different block behaviors (wood, metal, ice)
- Quantum Effects: Phase blocks and entangled pieces
- Advanced Physics: Sliding, bouncing, and instability
- Visual Effects: Animations and particle systems
- Audio System: Sound effects and background music
- Special Modes: Daily challenges and time trials
This project is licensed under the MIT License - see the LICENSE file for details.
This is a learning project demonstrating Android game development with modern tools. Feel free to fork and experiment with the code!