mirror of
https://github.com/cmclark00/mintris.git
synced 2025-05-18 13:15:21 +01:00
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:
parent
2774703df5
commit
7cdc9988cb
1 changed files with 137 additions and 57 deletions
|
@ -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,8 +603,23 @@ 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) {
|
||||||
|
"block_skin_1" -> { // Classic
|
||||||
|
// 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
|
||||||
|
blockPaint.color = if (isGhost) Color.argb(30, 255, 255, 255) else Color.WHITE
|
||||||
|
blockPaint.alpha = if (isGhost) 30 else 255
|
||||||
|
canvas.drawRect(left, top, right, bottom, blockPaint)
|
||||||
|
|
||||||
|
// Draw inner glow
|
||||||
|
glowPaint.color = if (isGhost) Color.argb(30, 255, 255, 255) else Color.WHITE
|
||||||
|
canvas.drawRect(left + 1f, top + 1f, right - 1f, bottom - 1f, glowPaint)
|
||||||
|
}
|
||||||
|
"block_skin_2" -> { // Neon
|
||||||
// Stronger outer glow for neon skin
|
// Stronger outer glow for neon skin
|
||||||
blockGlowPaint.color = if (isGhost) Color.argb(30, 255, 0, 255) else Color.parseColor("#FF00FF")
|
blockGlowPaint.color = if (isGhost) Color.argb(30, 255, 0, 255) else Color.parseColor("#FF00FF")
|
||||||
blockGlowPaint.maskFilter = BlurMaskFilter(16f, BlurMaskFilter.Blur.OUTER)
|
blockGlowPaint.maskFilter = BlurMaskFilter(16f, BlurMaskFilter.Blur.OUTER)
|
||||||
|
@ -635,27 +652,90 @@ class GameView @JvmOverloads constructor(
|
||||||
}
|
}
|
||||||
canvas.drawRect(left, top, right, bottom, borderPaint)
|
canvas.drawRect(left, top, right, bottom, borderPaint)
|
||||||
|
|
||||||
// Inner glow for neon blocks - brighter than before
|
// Inner glow for neon blocks
|
||||||
glowPaint.color = if (isGhost) Color.argb(10, 255, 0, 255) else Color.parseColor("#FF00FF")
|
glowPaint.color = if (isGhost) Color.argb(10, 255, 0, 255) else Color.parseColor("#FF00FF")
|
||||||
glowPaint.alpha = if (isGhost) 10 else 100 // More visible inner glow
|
glowPaint.alpha = if (isGhost) 10 else 100
|
||||||
glowPaint.style = Paint.Style.STROKE
|
glowPaint.style = Paint.Style.STROKE
|
||||||
glowPaint.strokeWidth = 2f
|
glowPaint.strokeWidth = 2f
|
||||||
glowPaint.maskFilter = BlurMaskFilter(4f, BlurMaskFilter.Blur.NORMAL)
|
glowPaint.maskFilter = BlurMaskFilter(4f, BlurMaskFilter.Blur.NORMAL)
|
||||||
canvas.drawRect(left + 4f, top + 4f, right - 4f, bottom - 4f, glowPaint)
|
canvas.drawRect(left + 4f, top + 4f, right - 4f, bottom - 4f, glowPaint)
|
||||||
} else {
|
}
|
||||||
// Standard rendering for other skins
|
"block_skin_3" -> { // Retro
|
||||||
// Draw outer glow
|
// Draw pixelated block with retro effect
|
||||||
blockGlowPaint.color = if (isGhost) Color.argb(30, 255, 255, 255) else Color.WHITE
|
blockPaint.color = if (isGhost) Color.argb(30, 255, 90, 95) else Color.parseColor("#FF5A5F")
|
||||||
canvas.drawRect(left - 2f, top - 2f, right + 2f, bottom + 2f, blockGlowPaint)
|
|
||||||
|
|
||||||
// Draw block with current skin
|
|
||||||
blockPaint.color = if (isGhost) Color.argb(30, 255, 255, 255) else blockPaint.color
|
|
||||||
blockPaint.alpha = if (isGhost) 30 else 255
|
blockPaint.alpha = if (isGhost) 30 else 255
|
||||||
|
|
||||||
|
// Draw main block
|
||||||
canvas.drawRect(left, top, right, bottom, blockPaint)
|
canvas.drawRect(left, top, right, bottom, blockPaint)
|
||||||
|
|
||||||
// Draw inner glow
|
// Draw pixelated highlights
|
||||||
glowPaint.color = if (isGhost) Color.argb(30, 255, 255, 255) else Color.WHITE
|
val highlightPaint = Paint().apply {
|
||||||
canvas.drawRect(left + 1f, top + 1f, right - 1f, bottom - 1f, glowPaint)
|
color = Color.parseColor("#FF8A8F")
|
||||||
|
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 pixelated shadows
|
||||||
|
val shadowPaint = Paint().apply {
|
||||||
|
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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue