2025-04-01 05:06:38 -04:00
|
|
|
# pixelmintdrop
|
2025-03-26 12:44:00 -04:00
|
|
|
|
2025-04-01 05:18:47 -04:00
|
|
|
A modern block-stacking puzzle game for Android, featuring smooth animations, responsive controls, and a beautiful minimalist design.
|
2025-03-26 12:44:00 -04:00
|
|
|
|
|
|
|
## Features
|
|
|
|
|
|
|
|
### Core Gameplay
|
2025-04-01 05:18:47 -04:00
|
|
|
- Classic block-stacking mechanics
|
2025-03-26 12:44:00 -04:00
|
|
|
- 7-bag randomizer for piece distribution
|
|
|
|
- Ghost piece preview
|
|
|
|
- Hard drop and soft drop
|
|
|
|
- T-Spin detection and scoring
|
2025-03-27 02:12:06 -04:00
|
|
|
- High score system with top 5 scores
|
2025-03-26 12:44:00 -04:00
|
|
|
|
|
|
|
### Modern Android Features
|
2025-03-27 02:12:06 -04:00
|
|
|
- Optimized for Android 11+ (API 30+)
|
2025-03-26 12:44:00 -04:00
|
|
|
- Hardware-accelerated rendering
|
|
|
|
- High refresh rate support
|
2025-03-27 02:12:06 -04:00
|
|
|
- Haptic feedback for piece movement and line clears
|
2025-03-26 12:44:00 -04:00
|
|
|
- Dark theme support
|
|
|
|
- Responsive touch controls
|
2025-03-27 02:12:06 -04:00
|
|
|
- Edge-to-edge display support
|
2025-03-26 12:44:00 -04:00
|
|
|
|
|
|
|
### Scoring System
|
|
|
|
|
2025-03-27 02:12:06 -04:00
|
|
|
The game features a comprehensive scoring system:
|
2025-03-26 12:44:00 -04:00
|
|
|
|
|
|
|
#### Base Scores
|
|
|
|
- Single line: 40 points
|
|
|
|
- Double: 100 points
|
|
|
|
- Triple: 300 points
|
2025-04-01 05:18:47 -04:00
|
|
|
- Quad (4 lines): 1200 points
|
2025-03-26 12:44:00 -04:00
|
|
|
|
|
|
|
#### Multipliers
|
|
|
|
|
|
|
|
1. **Level Multiplier**
|
|
|
|
- Score is multiplied by current level
|
|
|
|
- Level increases every 10 lines cleared
|
2025-03-27 02:12:06 -04:00
|
|
|
- Maximum level is 20
|
2025-03-26 12:44:00 -04:00
|
|
|
|
|
|
|
2. **Combo System**
|
|
|
|
- Combo counter increases with each line clear
|
|
|
|
- Resets if no lines are cleared
|
|
|
|
- Multipliers:
|
|
|
|
- 1 combo: 1.0x
|
|
|
|
- 2 combos: 1.5x
|
|
|
|
- 3 combos: 2.0x
|
|
|
|
- 4 combos: 2.5x
|
|
|
|
- 5+ combos: 3.0x
|
|
|
|
|
2025-04-01 05:18:47 -04:00
|
|
|
3. **Back-to-Back Quad**
|
|
|
|
- 50% bonus (1.5x) for consecutive quad clears
|
|
|
|
- Resets if a non-quad clear is performed
|
2025-03-26 12:44:00 -04:00
|
|
|
|
|
|
|
4. **Perfect Clear**
|
|
|
|
- 2x for single line
|
|
|
|
- 3x for double
|
|
|
|
- 4x for triple
|
2025-04-01 05:18:47 -04:00
|
|
|
- 5x for quad
|
2025-03-26 12:44:00 -04:00
|
|
|
- Awarded when clearing lines without leaving blocks
|
|
|
|
|
|
|
|
5. **All Clear**
|
|
|
|
- 2x multiplier when clearing all blocks
|
|
|
|
- Requires no blocks in grid and no pieces in play
|
|
|
|
|
|
|
|
6. **T-Spin Bonuses**
|
|
|
|
- Single: 2x
|
|
|
|
- Double: 4x
|
|
|
|
- Triple: 6x
|
|
|
|
|
|
|
|
### Controls
|
2025-03-27 02:14:24 -04:00
|
|
|
- Swipe left/right to move piece
|
|
|
|
- Swipe down quickly for hard drop
|
|
|
|
- Swipe down slowly for soft drop
|
2025-03-27 02:14:46 -04:00
|
|
|
- Single tap to rotate
|
2025-03-27 02:12:06 -04:00
|
|
|
|
|
|
|
### Visual Effects
|
|
|
|
- Smooth piece movement animations
|
|
|
|
- Pulsing border glow during line clears
|
|
|
|
- Ghost piece preview
|
|
|
|
- Block glow effects
|
|
|
|
- Subtle grid lines
|
|
|
|
- Animated title screen with falling pieces
|
2025-03-26 12:44:00 -04:00
|
|
|
|
|
|
|
## Technical Details
|
|
|
|
|
|
|
|
### Requirements
|
2025-03-27 02:12:06 -04:00
|
|
|
- Android 11 (API 30) or higher
|
|
|
|
- Hardware acceleration support
|
2025-03-26 12:44:00 -04:00
|
|
|
- 2GB RAM minimum
|
|
|
|
|
|
|
|
### Performance Optimizations
|
|
|
|
- Hardware-accelerated rendering
|
|
|
|
- Efficient collision detection
|
|
|
|
- Optimized grid operations
|
|
|
|
- Smooth animations at 60fps
|
2025-03-27 02:12:06 -04:00
|
|
|
- Background thread for score calculations
|
2025-03-26 12:44:00 -04:00
|
|
|
|
|
|
|
### Architecture
|
|
|
|
- Written in Kotlin
|
|
|
|
- Uses Android Canvas for rendering
|
|
|
|
- Follows Material Design guidelines
|
2025-03-27 02:12:06 -04:00
|
|
|
- Implements high score persistence using SharedPreferences
|
2025-03-26 12:44:00 -04:00
|
|
|
|
2025-03-31 21:08:37 -04:00
|
|
|
## Project Improvements and Best Practices
|
|
|
|
|
|
|
|
### Performance Optimizations
|
|
|
|
|
|
|
|
The codebase includes several performance optimizations:
|
|
|
|
|
|
|
|
1. **Release Build Configuration**
|
|
|
|
- Minification enabled to reduce APK size
|
|
|
|
- Resource shrinking to remove unused resources
|
|
|
|
- ProGuard rules to optimize while preserving critical classes
|
|
|
|
|
|
|
|
2. **Memory Management**
|
|
|
|
- Proper lifecycle handling to prevent memory leaks
|
|
|
|
- Resource cleanup through `releaseResources()` methods
|
|
|
|
- Efficient bitmap handling with reuse when possible
|
|
|
|
|
|
|
|
3. **Rendering Efficiency**
|
|
|
|
- Custom view invalidation limited to areas that need updating
|
|
|
|
- Hardware acceleration for canvas operations
|
|
|
|
- Bitmap caching for frequently used graphics
|
|
|
|
|
|
|
|
### Code Organization
|
|
|
|
|
|
|
|
The codebase follows good architecture practices:
|
|
|
|
|
|
|
|
1. **Package Structure**
|
|
|
|
- `model`: Data classes and game logic
|
|
|
|
- `game`: Core gameplay implementation
|
|
|
|
- `ui`: User interface components
|
|
|
|
- `audio`: Sound and music management
|
|
|
|
- `accessibility`: Accessibility helpers
|
|
|
|
|
|
|
|
2. **Responsibility Separation**
|
|
|
|
- `GameLifecycleManager`: Handles lifecycle events
|
|
|
|
- `GameUIManager`: Manages UI state and updates
|
|
|
|
- `GameAccessibilityHelper`: Improves accessibility features
|
|
|
|
- `GamepadController`: Manages gamepad input
|
|
|
|
|
|
|
|
### Google Play Compliance
|
|
|
|
|
|
|
|
The app meets Google Play standards:
|
|
|
|
|
|
|
|
1. **Manifest Configuration**
|
|
|
|
- Proper permissions declaration
|
|
|
|
- Screen orientation handling
|
|
|
|
- Full backup rules for user data
|
|
|
|
|
|
|
|
2. **Accessibility Support**
|
|
|
|
- Content descriptions for UI elements
|
|
|
|
- Color contrast considerations
|
|
|
|
- Screen reader compatibility
|
|
|
|
|
|
|
|
3. **Shortcuts and Deep Links**
|
|
|
|
- App shortcuts for quick actions
|
|
|
|
- Proper intent handling
|
|
|
|
|
|
|
|
### Usage Examples
|
|
|
|
|
|
|
|
#### Lifecycle Management
|
|
|
|
|
|
|
|
```kotlin
|
|
|
|
// In your activity
|
|
|
|
private lateinit var lifecycleManager: GameLifecycleManager
|
|
|
|
|
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
|
super.onCreate(savedInstanceState)
|
|
|
|
lifecycleManager = GameLifecycleManager(this)
|
|
|
|
}
|
|
|
|
|
|
|
|
override fun onPause() {
|
|
|
|
super.onPause()
|
|
|
|
lifecycleManager.onPause(gameView, gameMusic, statsManager, highScoreManager)
|
|
|
|
}
|
|
|
|
|
|
|
|
override fun onResume() {
|
|
|
|
super.onResume()
|
|
|
|
lifecycleManager.onResume(gameView, gameMusic, isMusicEnabled)
|
|
|
|
}
|
|
|
|
|
|
|
|
override fun onDestroy() {
|
|
|
|
lifecycleManager.onDestroy(gameView, gameMusic, statsManager, highScoreManager)
|
|
|
|
super.onDestroy()
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Accessibility Implementation
|
|
|
|
|
|
|
|
```kotlin
|
|
|
|
// In your activity
|
|
|
|
private lateinit var accessibilityHelper: GameAccessibilityHelper
|
|
|
|
|
|
|
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
|
|
super.onCreate(savedInstanceState)
|
|
|
|
accessibilityHelper = GameAccessibilityHelper(this)
|
|
|
|
|
|
|
|
// Setup accessibility descriptions for controls
|
|
|
|
accessibilityHelper.setupAccessibilityDescriptions(
|
|
|
|
leftButton, rightButton, rotateButton, dropButton,
|
|
|
|
holdButton, pauseButton, gameView, holdPieceView, nextPieceView
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
// When level changes
|
|
|
|
private fun onLevelUp(newLevel: Int) {
|
|
|
|
accessibilityHelper.announceLevelUp(gameView, newLevel)
|
|
|
|
}
|
|
|
|
|
|
|
|
// When game ends
|
|
|
|
private fun onGameOver(score: Long) {
|
|
|
|
accessibilityHelper.announceGameOver(gameView, score)
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2025-03-26 12:44:00 -04:00
|
|
|
## Building from Source
|
|
|
|
|
|
|
|
1. Clone the repository:
|
|
|
|
```bash
|
2025-04-01 05:06:38 -04:00
|
|
|
git clone https://github.com/cmclark00/pixelmintdrop.git
|
2025-03-26 12:44:00 -04:00
|
|
|
```
|
|
|
|
|
|
|
|
2. Open the project in Android Studio
|
|
|
|
|
|
|
|
3. Build and run on your device or emulator
|
|
|
|
|
|
|
|
## Contributing
|
|
|
|
|
|
|
|
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
This project is licensed under the MIT License - see the LICENSE file for details.
|