Enhance: Add hold piece control and theme customization options

- Introduced a new control for holding pieces with a swipe up gesture.
- Added multiple theme options with a Random Mode that changes themes automatically after clearing lines.
- Updated README to reflect new controls and visual features.
- Incremented version code and updated version name in build.gradle.
- Adjusted title and high score positioning based on screen orientation in TitleScreen.kt.
- Added "Enter Name" prompt in high score entry layout for better user experience.
This commit is contained in:
cmclark00 2025-04-02 00:29:50 -04:00
parent 2d9de31a38
commit 21b2513ad4
5 changed files with 39 additions and 14 deletions

View file

@ -62,6 +62,7 @@ Pixelmint Drop features a comprehensive scoring system designed to reward skillf
- **Swipe down quickly:** Hard drop (instant placement). - **Swipe down quickly:** Hard drop (instant placement).
- **Swipe down slowly:** Soft drop (faster downward movement). - **Swipe down slowly:** Soft drop (faster downward movement).
- **Single tap:** Rotate piece. - **Single tap:** Rotate piece.
- **Swipe up:** Hold piece.
### Visual Effects ### Visual Effects
- Silky-smooth piece movement animations. - Silky-smooth piece movement animations.
@ -70,6 +71,8 @@ Pixelmint Drop features a comprehensive scoring system designed to reward skillf
- Subtle block glow effects. - Subtle block glow effects.
- Clean grid lines for better visibility. - Clean grid lines for better visibility.
- Engaging animated title screen featuring falling pieces. - Engaging animated title screen featuring falling pieces.
- Multiple theme options with ability to change manually or enable Random Mode (unlocked when 2+ themes are available).
- In Random Mode, themes change automatically every 10 line clears (1 level).
## Technical Details ## Technical Details

View file

@ -11,8 +11,8 @@ android {
applicationId "com.pixelmintdrop" applicationId "com.pixelmintdrop"
minSdk 30 minSdk 30
targetSdk 35 targetSdk 35
versionCode 1 versionCode 2
versionName "1.0" versionName "0.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }

View file

@ -238,13 +238,20 @@ class TitleScreen @JvmOverloads constructor(
// Remove tetrominos that fell off the screen // Remove tetrominos that fell off the screen
tetrominos.removeAll(tetrominosToRemove) tetrominos.removeAll(tetrominosToRemove)
// Adjust high scores position based on title position
val highScoreY = if (resources.configuration.orientation == android.content.res.Configuration.ORIENTATION_LANDSCAPE) {
height * 0.45f // In landscape, position high scores below title with more space
} else {
height * 0.5f // In portrait, keep in middle of screen
}
// Position title based on orientation for optimal positioning // Position title based on orientation for optimal positioning
val titleY = if (resources.configuration.orientation == android.content.res.Configuration.ORIENTATION_LANDSCAPE) { val titleY = if (resources.configuration.orientation == android.content.res.Configuration.ORIENTATION_LANDSCAPE) {
// In landscape mode, position in upper third of screen // In landscape mode, position halfway between top and high scores
height * 0.3f highScoreY / 2
} else { } else {
// In portrait mode, center above high scores // In portrait mode, position halfway between top and high scores
height * 0.35f highScoreY / 2
} }
// Measure each word without spaces // Measure each word without spaces
@ -259,7 +266,11 @@ class TitleScreen @JvmOverloads constructor(
val totalWidth = pixelWidth + mintWidth + dropWidth + (wordSpacing * 2) val totalWidth = pixelWidth + mintWidth + dropWidth + (wordSpacing * 2)
// Start position for first word to center the entire title // Start position for first word to center the entire title
val startX = width / 2f - totalWidth / 2 val startX = if (resources.configuration.orientation == android.content.res.Configuration.ORIENTATION_LANDSCAPE) {
width / 2f - totalWidth / 2 // Center in landscape
} else {
width / 2f - totalWidth / 2 + 100f // Add offset to the right in portrait
}
// Draw "pixel" in theme color // Draw "pixel" in theme color
canvas.drawText("pixel", startX, titleY, titlePaint) canvas.drawText("pixel", startX, titleY, titlePaint)
@ -278,13 +289,6 @@ class TitleScreen @JvmOverloads constructor(
// Draw high scores using pre-allocated manager // Draw high scores using pre-allocated manager
val highScores: List<HighScore> = highScoreManager.getHighScores() val highScores: List<HighScore> = highScoreManager.getHighScores()
// Adjust high scores position based on title position
val highScoreY = if (resources.configuration.orientation == android.content.res.Configuration.ORIENTATION_LANDSCAPE) {
height * 0.45f // In landscape, position high scores below title with more space
} else {
height * 0.5f // In portrait, keep in middle of screen
}
var lastHighScoreY = highScoreY var lastHighScoreY = highScoreY
if (highScores.isNotEmpty()) { if (highScores.isNotEmpty()) {
// Calculate the starting X position to center the entire block of scores // Calculate the starting X position to center the entire block of scores

View file

@ -26,6 +26,15 @@
android:fontFamily="monospace" android:fontFamily="monospace"
android:layout_marginBottom="24dp"/> android:layout_marginBottom="24dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter Name"
android:textColor="@color/white"
android:textSize="22sp"
android:fontFamily="monospace"
android:layout_marginBottom="8dp"/>
<EditText <EditText
android:id="@+id/nameInput" android:id="@+id/nameInput"
android:layout_width="280dp" android:layout_width="280dp"

View file

@ -26,6 +26,15 @@
android:fontFamily="monospace" android:fontFamily="monospace"
android:layout_marginBottom="16dp"/> android:layout_marginBottom="16dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enter Name"
android:textColor="@color/white"
android:textSize="18sp"
android:fontFamily="monospace"
android:layout_marginBottom="8dp"/>
<EditText <EditText
android:id="@+id/nameInput" android:id="@+id/nameInput"
android:layout_width="200dp" android:layout_width="200dp"