fix: enhance block skins to match their respective themes - Classic: Clean white blocks with subtle glow - Neon: Strong glow effects with magenta colors - Retro: Pixelated look with highlights and shadows - Minimalist: Clean black blocks with subtle borders - Galaxy: Cosmic effects with gradient and sparkles

This commit is contained in:
cmclark00 2025-03-28 20:17:44 -04:00
parent 2774703df5
commit 7cdc9988cb

View file

@ -2,12 +2,14 @@ package com.mintris.game
import android.animation.ValueAnimator import android.animation.ValueAnimator
import android.content.Context import android.content.Context
import android.graphics.BlurMaskFilter
import android.graphics.Canvas import android.graphics.Canvas
import android.graphics.Color import android.graphics.Color
import android.graphics.LinearGradient
import android.graphics.Paint import android.graphics.Paint
import android.graphics.Rect import android.graphics.Rect
import android.graphics.RectF import android.graphics.RectF
import android.graphics.BlurMaskFilter import android.graphics.Shader
import android.os.Build import android.os.Build
import android.os.Handler import android.os.Handler
import android.os.Looper import android.os.Looper
@ -236,6 +238,7 @@ class GameView @JvmOverloads constructor(
blockSkinPaints["block_skin_1"] = Paint().apply { blockSkinPaints["block_skin_1"] = Paint().apply {
color = Color.WHITE color = Color.WHITE
isAntiAlias = true isAntiAlias = true
style = Paint.Style.FILL
} }
// Neon skin // Neon skin
@ -248,9 +251,8 @@ class GameView @JvmOverloads constructor(
// Retro skin // Retro skin
blockSkinPaints["block_skin_3"] = Paint().apply { blockSkinPaints["block_skin_3"] = Paint().apply {
color = Color.parseColor("#FF5A5F") color = Color.parseColor("#FF5A5F")
isAntiAlias = true isAntiAlias = false // Pixelated look
style = Paint.Style.STROKE style = Paint.Style.FILL
strokeWidth = 2f
} }
// Minimalist skin // Minimalist skin
@ -601,61 +603,139 @@ class GameView @JvmOverloads constructor(
// Create a clone of the paint to avoid modifying the original // Create a clone of the paint to avoid modifying the original
val blockPaint = Paint(paint) val blockPaint = Paint(paint)
// Special handling for neon skin // Draw block based on current skin
if (currentBlockSkin == "block_skin_2") { when (currentBlockSkin) {
// Stronger outer glow for neon skin "block_skin_1" -> { // Classic
blockGlowPaint.color = if (isGhost) Color.argb(30, 255, 0, 255) else Color.parseColor("#FF00FF") // Draw outer glow
blockGlowPaint.maskFilter = BlurMaskFilter(16f, BlurMaskFilter.Blur.OUTER) blockGlowPaint.color = if (isGhost) Color.argb(30, 255, 255, 255) else Color.WHITE
canvas.drawRect(left - 4f, top - 4f, right + 4f, bottom + 4f, blockGlowPaint) canvas.drawRect(left - 2f, top - 2f, right + 2f, bottom + 2f, blockGlowPaint)
// For neon, use semi-translucent fill with strong glowing edges // Draw block
blockPaint.style = Paint.Style.FILL_AND_STROKE blockPaint.color = if (isGhost) Color.argb(30, 255, 255, 255) else Color.WHITE
blockPaint.strokeWidth = 2f blockPaint.alpha = if (isGhost) 30 else 255
blockPaint.maskFilter = BlurMaskFilter(8f, BlurMaskFilter.Blur.NORMAL) canvas.drawRect(left, top, right, bottom, blockPaint)
if (isGhost) { // Draw inner glow
blockPaint.color = Color.argb(30, 255, 0, 255) glowPaint.color = if (isGhost) Color.argb(30, 255, 255, 255) else Color.WHITE
blockPaint.alpha = 30 canvas.drawRect(left + 1f, top + 1f, right - 1f, bottom - 1f, glowPaint)
} else {
blockPaint.color = Color.parseColor("#66004D") // Darker magenta fill
blockPaint.alpha = 170 // More opaque to be more visible
} }
"block_skin_2" -> { // Neon
// Stronger outer glow for neon skin
blockGlowPaint.color = if (isGhost) Color.argb(30, 255, 0, 255) else Color.parseColor("#FF00FF")
blockGlowPaint.maskFilter = BlurMaskFilter(16f, BlurMaskFilter.Blur.OUTER)
canvas.drawRect(left - 4f, top - 4f, right + 4f, bottom + 4f, blockGlowPaint)
// Draw block with neon effect // For neon, use semi-translucent fill with strong glowing edges
canvas.drawRect(left, top, right, bottom, blockPaint) blockPaint.style = Paint.Style.FILL_AND_STROKE
blockPaint.strokeWidth = 2f
blockPaint.maskFilter = BlurMaskFilter(8f, BlurMaskFilter.Blur.NORMAL)
// Draw a brighter border for better visibility if (isGhost) {
val borderPaint = Paint().apply { blockPaint.color = Color.argb(30, 255, 0, 255)
color = Color.parseColor("#FF00FF") blockPaint.alpha = 30
style = Paint.Style.STROKE } else {
strokeWidth = 3f blockPaint.color = Color.parseColor("#66004D") // Darker magenta fill
alpha = 255 blockPaint.alpha = 170 // More opaque to be more visible
isAntiAlias = true }
maskFilter = BlurMaskFilter(6f, BlurMaskFilter.Blur.NORMAL)
// Draw block with neon effect
canvas.drawRect(left, top, right, bottom, blockPaint)
// Draw a brighter border for better visibility
val borderPaint = Paint().apply {
color = Color.parseColor("#FF00FF")
style = Paint.Style.STROKE
strokeWidth = 3f
alpha = 255
isAntiAlias = true
maskFilter = BlurMaskFilter(6f, BlurMaskFilter.Blur.NORMAL)
}
canvas.drawRect(left, top, right, bottom, borderPaint)
// Inner glow for neon blocks
glowPaint.color = if (isGhost) Color.argb(10, 255, 0, 255) else Color.parseColor("#FF00FF")
glowPaint.alpha = if (isGhost) 10 else 100
glowPaint.style = Paint.Style.STROKE
glowPaint.strokeWidth = 2f
glowPaint.maskFilter = BlurMaskFilter(4f, BlurMaskFilter.Blur.NORMAL)
canvas.drawRect(left + 4f, top + 4f, right - 4f, bottom - 4f, glowPaint)
} }
canvas.drawRect(left, top, right, bottom, borderPaint) "block_skin_3" -> { // Retro
// Draw pixelated block with retro effect
blockPaint.color = if (isGhost) Color.argb(30, 255, 90, 95) else Color.parseColor("#FF5A5F")
blockPaint.alpha = if (isGhost) 30 else 255
// Inner glow for neon blocks - brighter than before // Draw main block
glowPaint.color = if (isGhost) Color.argb(10, 255, 0, 255) else Color.parseColor("#FF00FF") canvas.drawRect(left, top, right, bottom, blockPaint)
glowPaint.alpha = if (isGhost) 10 else 100 // More visible inner glow
glowPaint.style = Paint.Style.STROKE
glowPaint.strokeWidth = 2f
glowPaint.maskFilter = BlurMaskFilter(4f, BlurMaskFilter.Blur.NORMAL)
canvas.drawRect(left + 4f, top + 4f, right - 4f, bottom - 4f, glowPaint)
} else {
// Standard rendering for other skins
// Draw outer glow
blockGlowPaint.color = if (isGhost) Color.argb(30, 255, 255, 255) else Color.WHITE
canvas.drawRect(left - 2f, top - 2f, right + 2f, bottom + 2f, blockGlowPaint)
// Draw block with current skin // Draw pixelated highlights
blockPaint.color = if (isGhost) Color.argb(30, 255, 255, 255) else blockPaint.color val highlightPaint = Paint().apply {
blockPaint.alpha = if (isGhost) 30 else 255 color = Color.parseColor("#FF8A8F")
canvas.drawRect(left, top, right, bottom, blockPaint) isAntiAlias = false
style = Paint.Style.FILL
}
// Top and left highlights
canvas.drawRect(left, top, right - 2f, top + 2f, highlightPaint)
canvas.drawRect(left, top, left + 2f, bottom - 2f, highlightPaint)
// Draw inner glow // Draw pixelated shadows
glowPaint.color = if (isGhost) Color.argb(30, 255, 255, 255) else Color.WHITE val shadowPaint = Paint().apply {
canvas.drawRect(left + 1f, top + 1f, right - 1f, bottom - 1f, glowPaint) color = Color.parseColor("#CC4A4F")
isAntiAlias = false
style = Paint.Style.FILL
}
// Bottom and right shadows
canvas.drawRect(left + 2f, bottom - 2f, right, bottom, shadowPaint)
canvas.drawRect(right - 2f, top + 2f, right, bottom - 2f, shadowPaint)
}
"block_skin_4" -> { // Minimalist
// Draw clean, simple block with subtle border
blockPaint.color = if (isGhost) Color.argb(30, 0, 0, 0) else Color.BLACK
blockPaint.alpha = if (isGhost) 30 else 255
blockPaint.style = Paint.Style.FILL
canvas.drawRect(left, top, right, bottom, blockPaint)
// Draw subtle border
val borderPaint = Paint().apply {
color = Color.parseColor("#333333")
style = Paint.Style.STROKE
strokeWidth = 1f
isAntiAlias = true
}
canvas.drawRect(left, top, right, bottom, borderPaint)
}
"block_skin_5" -> { // Galaxy
// Draw cosmic glow effect
blockGlowPaint.color = if (isGhost) Color.argb(30, 102, 252, 241) else Color.parseColor("#66FCF1")
blockGlowPaint.maskFilter = BlurMaskFilter(20f, BlurMaskFilter.Blur.OUTER)
canvas.drawRect(left - 8f, top - 8f, right + 8f, bottom + 8f, blockGlowPaint)
// Draw main block with gradient
val gradient = LinearGradient(
left, top, right, bottom,
Color.parseColor("#66FCF1"),
Color.parseColor("#45B7AF"),
Shader.TileMode.CLAMP
)
blockPaint.shader = gradient
blockPaint.color = if (isGhost) Color.argb(30, 102, 252, 241) else Color.parseColor("#66FCF1")
blockPaint.alpha = if (isGhost) 30 else 255
blockPaint.style = Paint.Style.FILL
canvas.drawRect(left, top, right, bottom, blockPaint)
// Draw star-like sparkles
if (!isGhost) {
val sparklePaint = Paint().apply {
color = Color.WHITE
style = Paint.Style.FILL
isAntiAlias = true
maskFilter = BlurMaskFilter(4f, BlurMaskFilter.Blur.NORMAL)
}
// Add small white dots for sparkle effect
canvas.drawCircle(left + 4f, top + 4f, 1f, sparklePaint)
canvas.drawCircle(right - 4f, bottom - 4f, 1f, sparklePaint)
}
}
} }
// Draw pulse effect if animation is active and this is a pulsing line // Draw pulse effect if animation is active and this is a pulsing line