A modern Android block puzzle game built with Kotlin and Jetpack Compose, featuring drag & drop gameplay, rotation, hold mechanics, scoring, sound effects and a premium Liquid Glass interface.
Android Application · Kotlin · Jetpack Compose · Material 3 · Canvas
|
A modern block puzzle game combining simple puzzle mechanics, |
PuzzleNest is an Android block puzzle game focused on clean gameplay, responsive interactions, visual polish and lightweight performance.
PuzzleNest is a modern Android block puzzle game inspired by classic 1010-style puzzle mechanics.
The game provides a simple but engaging gameplay loop where players place randomly generated pieces on an 8×8 grid, clear completed rows and columns, earn points and continue playing until no available piece can be placed.
The application focuses on:
- ✓ 8×8 puzzle board
- ✓ Drag & drop piece placement
- ✓ Ghost piece preview
- ✓ Piece rotation
- ✓ Hold mechanic
- ✓ Score tracking
- ✓ Best score tracking
- ✓ Row and column clearing
- ✓ Score pop animations
- ✓ Refresh mechanic
- ✓ Game-over detection
- ✓ Game-over warning state
- ✓ Haptic feedback
- ✓ Gameplay sound effects
- ✓ Multiple color palettes
- ✓ Premium Liquid Glass inspired UI
- ✓ Responsive Android layout
Core idea:
GENERATE
↓
DRAG
↓
PLACE
↓
CLEAR
↓
SCORE
↓
CONTINUE
PuzzleNest uses an 8×8 board where players place different block shapes generated in the game tray.
Three pieces are available at a time.
Players can:
- Drag a piece onto the board
- Preview its placement using a ghost shape
- Rotate pieces
- Store a piece using the Hold box
- Clear completed rows
- Clear completed columns
- Earn points from successful placements and clears
- Refresh available pieces when enough points are available
The game continues as long as at least one available piece can be legally placed on the board.
|
8×8 Puzzle Board Drag & Drop Ghost Preview Piece Rotation Hold Mechanic Line Clearing |
Score System Refresh Mechanic Game Over Detection Sound Effects Haptic Feedback Multiple Themes |
┌─────────────────┐
│ Game Start │
└────────┬────────┘
↓
┌─────────────────┐
│ Generate Pieces │
└────────┬────────┘
↓
┌─────────────────┐
│ Select a Piece │
└────────┬────────┘
↓
┌─────────────────┐
│ Drag Piece │
└────────┬────────┘
↓
┌─────────────────┐
│ Ghost Preview │
└────────┬────────┘
↓
┌─────────────┐
│ Valid Place?│
└──────┬──────┘
Yes │ No
│
┌─────────────┘
↓
┌──────────────────┐
│ Place the Piece │
└────────┬─────────┘
↓
┌──────────────────┐
│ Check Completed │
│ Rows / Columns │
└────────┬─────────┘
↓
┌──────────────────┐
│ Update Score │
└────────┬─────────┘
↓
┌──────────────────┐
│ Generate / Use │
│ Available Pieces │
└────────┬─────────┘
↓
┌──────────────────┐
│ Moves Available? │
└───────┬──────────┘
Yes │ No
│
Continue Game Over
PuzzleNest follows a clean separation between UI, state management and game logic.
flowchart TD
A[Jetpack Compose UI] --> B[GameScreen]
B --> C[GameViewModel]
C --> D[GameEngine]
D --> E[GameState]
C --> F[SoundManager]
B --> G[GameGrid]
B --> H[DraggableShapePreview]
B --> I[HoldBox]
B --> J[ScoreBar]
B --> K[Game Over UI]
B --> L[Settings UI]
UI
↓
GameScreen
↓
GameViewModel
↓
GameEngine
↓
GameState
Responsible for core game calculations such as:
- Piece placement
- Board validation
- Row clearing
- Column clearing
- Score-related game calculations
- Available move validation
- Game-over conditions
Responsible for:
- Game state management
- UI state
- User actions
- Drag state
- Hold state
- Refresh actions
- Score updates
- Sound event triggering
- Game lifecycle handling
Responsible for:
- Rendering the board
- Rendering pieces
- Drag interactions
- Animations
- Score presentation
- Settings
- Game-over presentation
- Visual feedback
PuzzleNest uses a custom dark Liquid Glass inspired visual system built with Jetpack Compose.
The design focuses on:
- Deep navy background
- Translucent glass surfaces
- Subtle borders
- Blue and purple accents
- Soft shadows
- Rounded containers
- Clean typography
- Lightweight gradients
- Controlled visual hierarchy
GameScreen
├── ScoreBar
├── GameGrid
├── DraggableShapePreview
├── HoldBox
├── Refresh Button
├── ScorePopOverlay
├── GameOverWarningOverlay
└── GameOverOverlay
The Settings screen provides controls for:
- Haptic Feedback
- Fair Shapes
- Color Palette
Available palettes:
Jewel
Earthy
Pastel
Neon
Wood
The visual system is shared across the game screen, settings screen, splash screen and game-over states.
Performance was treated as an important part of the implementation.
High-frequency finger movement is handled separately from semantic drag state updates.
This reduces unnecessary recomposition while the player is moving a piece.
The 8×8 board is rendered using a single Compose Canvas.
This keeps board rendering lightweight while allowing:
- Grid rendering
- Block rendering
- Ghost pieces
- Highlights
- Clear animations
Animation state reads are deferred into appropriate drawing and layout phases where possible.
This helps reduce unnecessary recomposition during animations.
Score pop items use stable identity keys so that animation state remains associated with the correct score event.
The Liquid Glass design avoids:
- Full-screen blur
- Heavy rendering effects
- Animated background particles
- Large image assets
- Unnecessary third-party UI libraries
The visual design primarily uses:
Gradients
+
Translucent surfaces
+
Borders
+
Shadows
+
Canvas drawing
PuzzleNest uses Android's native SoundPool API for short gameplay sound effects.
Sound events include:
Place
Clear
Invalid Move
Rotate
Hold
Refresh
Game Over
The sound system is designed for low-latency short gameplay feedback without adding an external audio dependency.
Sound resources are stored locally inside the Android application.
PuzzleGame/
│
├── app/
│ ├── src/
│ │ └── main/
│ │ ├── java/com/example/puzzlegame/
│ │ │
│ │ ├── data/
│ │ │ └── Game data / persistence components
│ │ │
│ │ ├── logic/
│ │ │ ├── GameEngine.kt
│ │ │ └── SoundManager.kt
│ │ │
│ │ ├── model/
│ │ │ └── Game models and state definitions
│ │ │
│ │ ├── ui/
│ │ │ ├── components/
│ │ │ │ ├── DraggableShapePreview.kt
│ │ │ │ ├── GameGrid.kt
│ │ │ │ ├── HoldBox.kt
│ │ │ │ ├── ScoreBar.kt
│ │ │ │ └── ScorePopOverlay.kt
│ │ │ │
│ │ │ ├── screens/
│ │ │ │ ├── GameScreen.kt
│ │ │ │ ├── SettingsScreen.kt
│ │ │ │ ├── SplashOverlay.kt
│ │ │ │ ├── GameOverOverlay.kt
│ │ │ │ └── GameOverWarningOverlay.kt
│ │ │ │
│ │ │ └── theme/
│ │ │ ├── Color.kt
│ │ │ ├── Theme.kt
│ │ │ └── Type.kt
│ │ │
│ │ ├── viewModel/
│ │ │ └── GameViewModel.kt
│ │ │
│ │ └── MainActivity.kt
│ │
│ └── src/main/res/
│ ├── drawable/
│ ├── mipmap/
│ ├── raw/
│ └── values/
│
├── gradle/
│ └── libs.versions.toml
│
├── build.gradle.kts
├── settings.gradle.kts
├── gradle.properties
├── gradlew
├── gradlew.bat
└── README.md
git clone https://github.com/allknowledge34/PuzzleGame.git
cd PuzzleGameOpen the project in Android Studio.
Recommended environment:
Android Studio
Kotlin
Android SDK
Jetpack Compose
Allow Android Studio to synchronize the project and download the required dependencies.
Connect a physical Android device or start an Android Emulator.
./gradlew installDebugOr simply run the app configuration from Android Studio.
./gradlew assembleDebug./gradlew installDebugThe application can also be built and launched directly from Android Studio using the standard app run configuration.
| Technology | Purpose |
|---|---|
| Kotlin | Application development |
| Jetpack Compose | Modern Android UI |
| Material 3 | UI components and theming |
| Compose Canvas | Puzzle board rendering |
| MVVM | Application architecture |
| Coroutines | Asynchronous state handling |
| Android SoundPool | Gameplay audio |
| Android Haptics | Tactile feedback |
| Gradle Kotlin DSL | Build configuration |
| Android SDK | Platform APIs |
Minimum SDK: 26
Compile SDK: 36
Target SDK: 36
Language: Kotlin
UI: Jetpack Compose
The game uses an:
8 × 8
grid.
The player receives three randomly generated pieces at a time.
A piece can only be placed when all of its occupied cells fit within the board and do not overlap existing blocks.
Whenever a complete row or column is formed, it is cleared automatically.
Players receive points through successful gameplay and completed line clears.
One piece can be stored in the Hold box and used later.
Available pieces can be refreshed using the in-game point cost when the player has sufficient points.
The game enters the game-over state when none of the available pieces can be legally placed.
A short warning state provides visual and haptic feedback before the final game-over state.
Potential future improvements include:
- Additional puzzle shapes
- More gameplay modes
- Daily challenges
- Leaderboards
- Achievement system
- Statistics dashboard
- More visual themes
- Advanced animations
- Additional sound packs
- Cloud-based score synchronization
- Accessibility improvements
- Expanded game settings
- Additional board sizes
- Replay system
Sachin Kumar
B.Tech Computer Science & Engineering
PuzzleNest — Modern Android Block Puzzle Game
Built with:
Kotlin
Android
Jetpack Compose
Material 3
Compose Canvas
MVVM
Android SoundPool
PuzzleNest was originally developed as part of a SMARRTIF AI assessment.
The project was developed as an Android implementation demonstrating practical application development, UI implementation, interaction handling, game logic and overall software development skills.