feat: R8 난독화 적용, Fragment 1.8.6 업그레이드, 스테이지 해금 및 도장 연출 개선
This commit is contained in:
Generated
-2373
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,20 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024">
|
||||
<defs>
|
||||
<filter id="rough" x="-15%" y="-15%" width="130%" height="130%">
|
||||
<feTurbulence type="fractalNoise" baseFrequency="0.025" numOctaves="2" seed="18" result="noise"/>
|
||||
<feDisplacementMap in="SourceGraphic" in2="noise" scale="4" xChannelSelector="R" yChannelSelector="G"/>
|
||||
</filter>
|
||||
</defs>
|
||||
<!-- Upright vermilion seal frame with a true transparent center. -->
|
||||
<g filter="url(#rough)">
|
||||
<path fill="#a91419" fill-rule="evenodd" opacity=".95" d="M218 172 Q229 162 250 166 L770 166 Q792 170 796 191 L796 743 Q791 764 769 767 L252 767 Q229 763 226 742 Z M304 252 Q304 244 316 244 L706 244 Q718 245 718 257 L718 669 Q718 681 706 682 L316 682 Q304 681 304 669 Z"/>
|
||||
<path d="M257 207 Q262 201 278 201 L741 201 Q757 204 757 220 L757 708 Q755 725 739 727 L283 727 Q266 724 265 708 Z" fill="none" stroke="#f3ddc3" stroke-width="13" opacity=".95"/>
|
||||
<path d="M286 236 Q292 228 306 229 L713 229 Q730 231 730 247 L730 680 Q728 697 712 698 L309 698 Q292 696 292 679 Z" fill="none" stroke="#f3ddc3" stroke-width="4" opacity=".72"/>
|
||||
<!-- Corner key marks sit on the frame; the center remains completely empty. -->
|
||||
<path d="M323 272h91v14h-75v90h-16zm378 0h-91v14h75v90h16zM323 655h91v-14h-75v-90h-16zm378 0h-91v-14h75v-90h16z" fill="#f3ddc3" opacity=".9"/>
|
||||
</g>
|
||||
<g fill="#a91419" opacity=".8">
|
||||
<circle cx="194" cy="326" r="7"/><circle cx="824" cy="402" r="6"/><circle cx="208" cy="694" r="5"/>
|
||||
<path d="M800 238l14-7 3 12-15 5zM782 770l10-5 4 8-12 6z"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
width="1024"
|
||||
height="1024"
|
||||
viewBox="0 0 1024 1024"
|
||||
version="1.1"
|
||||
id="svg6"
|
||||
sodipodi:docname="congrats-seal_bg.svg"
|
||||
inkscape:version="1.4.3 (0d15f75042, 2025-12-25)"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview6"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#000000"
|
||||
borderopacity="0.25"
|
||||
inkscape:showpageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:deskcolor="#d1d1d1"
|
||||
inkscape:zoom="0.84570312"
|
||||
inkscape:cx="512"
|
||||
inkscape:cy="512"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1128"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg6" />
|
||||
<defs
|
||||
id="defs1">
|
||||
<filter
|
||||
id="rough"
|
||||
x="0"
|
||||
y="0"
|
||||
width="1"
|
||||
height="1">
|
||||
<feTurbulence
|
||||
type="fractalNoise"
|
||||
baseFrequency="0.025"
|
||||
numOctaves="2"
|
||||
seed="18"
|
||||
result="noise"
|
||||
id="feTurbulence1" />
|
||||
<feDisplacementMap
|
||||
in="SourceGraphic"
|
||||
in2="noise"
|
||||
scale="4"
|
||||
xChannelSelector="R"
|
||||
yChannelSelector="G"
|
||||
id="feDisplacementMap1" />
|
||||
</filter>
|
||||
</defs>
|
||||
<!-- Upright vermilion seal frame with a true transparent center. -->
|
||||
<rect
|
||||
style="fill:#ffffff;fill-opacity:1;stroke-width:1.13167;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10.9"
|
||||
id="rect6"
|
||||
width="688.18475"
|
||||
height="703.55658"
|
||||
x="160.81293"
|
||||
y="111.15011"
|
||||
ry="37.50769" />
|
||||
<g
|
||||
filter="url(#rough)"
|
||||
id="g4">
|
||||
<path
|
||||
fill="#a91419"
|
||||
fill-rule="evenodd"
|
||||
opacity=".95"
|
||||
d="M218 172 Q229 162 250 166 L770 166 Q792 170 796 191 L796 743 Q791 764 769 767 L252 767 Q229 763 226 742 Z M304 252 Q304 244 316 244 L706 244 Q718 245 718 257 L718 669 Q718 681 706 682 L316 682 Q304 681 304 669 Z"
|
||||
id="path1" />
|
||||
<path
|
||||
d="M257 207 Q262 201 278 201 L741 201 Q757 204 757 220 L757 708 Q755 725 739 727 L283 727 Q266 724 265 708 Z"
|
||||
fill="none"
|
||||
stroke="#f3ddc3"
|
||||
stroke-width="13"
|
||||
opacity=".95"
|
||||
id="path2" />
|
||||
<path
|
||||
d="M286 236 Q292 228 306 229 L713 229 Q730 231 730 247 L730 680 Q728 697 712 698 L309 698 Q292 696 292 679 Z"
|
||||
fill="none"
|
||||
stroke="#f3ddc3"
|
||||
stroke-width="4"
|
||||
opacity=".72"
|
||||
id="path3" />
|
||||
<!-- Corner key marks sit on the frame; the center remains completely empty. -->
|
||||
<path
|
||||
d="M323 272h91v14h-75v90h-16zm378 0h-91v14h75v90h16zM323 655h91v-14h-75v-90h-16zm378 0h-91v-14h75v-90h16z"
|
||||
fill="#f3ddc3"
|
||||
opacity=".9"
|
||||
id="path4" />
|
||||
</g>
|
||||
<g
|
||||
fill="#a91419"
|
||||
opacity=".8"
|
||||
id="g6">
|
||||
<circle
|
||||
cx="194"
|
||||
cy="326"
|
||||
r="7"
|
||||
id="circle4" />
|
||||
<circle
|
||||
cx="824"
|
||||
cy="402"
|
||||
r="6"
|
||||
id="circle5" />
|
||||
<circle
|
||||
cx="208"
|
||||
cy="694"
|
||||
r="5"
|
||||
id="circle6" />
|
||||
<path
|
||||
d="M800 238l14-7 3 12-15 5zM782 770l10-5 4 8-12 6z"
|
||||
id="path6" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.3 KiB |
@@ -13,8 +13,8 @@ android {
|
||||
applicationId = "com.wordpuzzle.hangul"
|
||||
minSdk = 26
|
||||
targetSdk = 36
|
||||
versionCode = 6
|
||||
versionName = "1.1.4"
|
||||
versionCode = 7
|
||||
versionName = "1.1.5"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
@@ -31,7 +31,8 @@ android {
|
||||
buildTypes {
|
||||
release {
|
||||
signingConfig = signingConfigs.getByName("release")
|
||||
isMinifyEnabled = false
|
||||
isMinifyEnabled = true
|
||||
isShrinkResources = true
|
||||
proguardFiles(
|
||||
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||
"proguard-rules.pro"
|
||||
@@ -52,6 +53,7 @@ android {
|
||||
|
||||
dependencies {
|
||||
implementation(libs.androidx.core.ktx)
|
||||
implementation(libs.androidx.fragment.ktx)
|
||||
implementation(libs.androidx.lifecycle.runtime.ktx)
|
||||
implementation(libs.androidx.lifecycle.viewmodel.compose)
|
||||
implementation(libs.androidx.activity.compose)
|
||||
|
||||
Vendored
+16
-1
@@ -1,3 +1,18 @@
|
||||
# Proguard rules
|
||||
# Proguard / R8 rules for WordPuzzle
|
||||
|
||||
# Keep Data Models for Gson JSON serialization & Room Database
|
||||
-keep class com.wordpuzzle.hangul.data.model.** { *; }
|
||||
-keep class com.wordpuzzle.hangul.data.local.** { *; }
|
||||
|
||||
# Keep Gson serialization annotations
|
||||
-keepattributes *Annotation*
|
||||
-keepattributes Signature
|
||||
-keepclassmembers class * {
|
||||
@com.google.gson.annotations.SerializedName <fields>;
|
||||
}
|
||||
|
||||
# Keep Google Mobile Ads (AdMob)
|
||||
-keep class com.google.android.gms.ads.** { *; }
|
||||
|
||||
# Keep Firebase Remote Config
|
||||
-keep class com.google.firebase.** { *; }
|
||||
|
||||
@@ -68,6 +68,7 @@ fun WordPuzzleAppNavHost(
|
||||
) {
|
||||
val navController = rememberNavController()
|
||||
val currentUnlockedStage by prefs.currentStageFlow.collectAsState(initial = 1)
|
||||
val maxUnlockedStage by prefs.maxUnlockedStageFlow.collectAsState(initial = 1)
|
||||
val hintCount by prefs.hintCountFlow.collectAsState(initial = 3)
|
||||
val coroutineScope = rememberCoroutineScope()
|
||||
|
||||
@@ -80,12 +81,12 @@ fun WordPuzzleAppNavHost(
|
||||
currentUnlockedStage = currentUnlockedStage,
|
||||
hintCount = hintCount,
|
||||
onContinueGame = { stageNum ->
|
||||
navController.navigate("game/$stageNum")
|
||||
navController.navigate("game/$stageNum?isSelectionMode=false")
|
||||
},
|
||||
onRestartGame = {
|
||||
coroutineScope.launch {
|
||||
prefs.setStageCleared(0) // 진행 단계 1단계로 리셋
|
||||
navController.navigate("game/1")
|
||||
prefs.resetContinueStage() // 이어하기 단계 1단계로 리셋
|
||||
navController.navigate("game/1?isSelectionMode=false")
|
||||
}
|
||||
},
|
||||
onNavigateToStageSelection = {
|
||||
@@ -104,9 +105,9 @@ fun WordPuzzleAppNavHost(
|
||||
|
||||
composable("stage_selection") {
|
||||
StageSelectionScreen(
|
||||
currentUnlockedStage = currentUnlockedStage,
|
||||
currentUnlockedStage = maxUnlockedStage,
|
||||
onSelectStage = { stageNum ->
|
||||
navController.navigate("game/$stageNum")
|
||||
navController.navigate("game/$stageNum?isSelectionMode=true")
|
||||
},
|
||||
onNavigateBack = {
|
||||
navController.popBackStack()
|
||||
@@ -115,17 +116,25 @@ fun WordPuzzleAppNavHost(
|
||||
}
|
||||
|
||||
composable(
|
||||
route = "game/{stageNumber}",
|
||||
arguments = listOf(navArgument("stageNumber") { type = NavType.IntType })
|
||||
route = "game/{stageNumber}?isSelectionMode={isSelectionMode}",
|
||||
arguments = listOf(
|
||||
navArgument("stageNumber") { type = NavType.IntType },
|
||||
navArgument("isSelectionMode") {
|
||||
type = NavType.BoolType
|
||||
defaultValue = false
|
||||
}
|
||||
)
|
||||
) { backStackEntry ->
|
||||
val stageNumber = backStackEntry.arguments?.getInt("stageNumber") ?: 1
|
||||
val isSelectionMode = backStackEntry.arguments?.getBoolean("isSelectionMode") ?: false
|
||||
GameScreen(
|
||||
stageNumber = stageNumber,
|
||||
isSelectionMode = isSelectionMode,
|
||||
onNavigateBack = {
|
||||
navController.popBackStack()
|
||||
},
|
||||
onNavigateToNextStage = { nextStage ->
|
||||
navController.navigate("game/$nextStage") {
|
||||
navController.navigate("game/$nextStage?isSelectionMode=$isSelectionMode") {
|
||||
popUpTo("lobby")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ class UserPreferencesManager(private val context: Context) {
|
||||
const val MAX_DAILY_AD_HINTS = 3 // 일일 무료 광고 시청 횟수 3회로 변경
|
||||
const val MAX_HINT_LIMIT = 5 // 힌트 최대 보유 제한 5개
|
||||
private val KEY_CURRENT_STAGE = intPreferencesKey("current_stage")
|
||||
private val KEY_MAX_UNLOCKED_STAGE = intPreferencesKey("max_unlocked_stage")
|
||||
private val KEY_HINT_COUNT = intPreferencesKey("hint_count")
|
||||
private val KEY_LAST_AD_DATE = stringPreferencesKey("last_ad_date")
|
||||
private val KEY_DAILY_AD_WATCH_COUNT = intPreferencesKey("daily_ad_watch_count")
|
||||
@@ -78,6 +79,18 @@ class UserPreferencesManager(private val context: Context) {
|
||||
.catch { emit(emptyPreferences()) }
|
||||
.map { preferences -> preferences[KEY_CURRENT_STAGE] ?: 1 }
|
||||
|
||||
/**
|
||||
* 스테이지 선택 화면에서 사용되는 최고 해금 스테이지 Flow
|
||||
* (한번이라도 도달하거나 클리어한 스테이지는 새로하기에 영향 받지 않고 영구 해금 보존)
|
||||
*/
|
||||
val maxUnlockedStageFlow: Flow<Int> = context.dataStore.data
|
||||
.catch { emit(emptyPreferences()) }
|
||||
.map { preferences ->
|
||||
val current = preferences[KEY_CURRENT_STAGE] ?: 1
|
||||
val maxUnlocked = preferences[KEY_MAX_UNLOCKED_STAGE] ?: 1
|
||||
maxOf(current, maxUnlocked)
|
||||
}
|
||||
|
||||
val hintCountFlow: Flow<Int> = context.dataStore.data
|
||||
.catch { emit(emptyPreferences()) }
|
||||
.map { preferences -> preferences[KEY_HINT_COUNT] ?: 3 }
|
||||
@@ -122,11 +135,30 @@ class UserPreferencesManager(private val context: Context) {
|
||||
.catch { emit(emptyPreferences()) }
|
||||
.map { preferences -> preferences[KEY_PRE_LEARNED_WORDS] ?: emptySet() }
|
||||
|
||||
suspend fun setStageCleared(clearedStage: Int) {
|
||||
suspend fun resetContinueStage() {
|
||||
context.dataStore.edit { preferences ->
|
||||
val current = preferences[KEY_CURRENT_STAGE] ?: 1
|
||||
if (clearedStage >= current) {
|
||||
preferences[KEY_CURRENT_STAGE] = clearedStage + 1
|
||||
preferences[KEY_CURRENT_STAGE] = 1
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun updateStageProgress(playedStage: Int, isCleared: Boolean = false) {
|
||||
context.dataStore.edit { preferences ->
|
||||
val currentMax = preferences[KEY_MAX_UNLOCKED_STAGE] ?: 1
|
||||
val currentContinue = preferences[KEY_CURRENT_STAGE] ?: 1
|
||||
val nextUnlock = if (isCleared) playedStage + 1 else playedStage
|
||||
val newMax = maxOf(currentMax, currentContinue, nextUnlock)
|
||||
if (newMax > currentMax) {
|
||||
preferences[KEY_MAX_UNLOCKED_STAGE] = newMax
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun updateContinueStage(nextStage: Int) {
|
||||
context.dataStore.edit { preferences ->
|
||||
preferences[KEY_CURRENT_STAGE] = nextStage
|
||||
val currentMax = preferences[KEY_MAX_UNLOCKED_STAGE] ?: 1
|
||||
if (nextStage > currentMax) {
|
||||
preferences[KEY_MAX_UNLOCKED_STAGE] = nextStage
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,9 +38,9 @@ private class FastConfettiSystem(val count: Int) {
|
||||
val rand = Random(42)
|
||||
for (i in 0 until count) {
|
||||
x[i] = rand.nextFloat() * 1000f
|
||||
y[i] = -30f - rand.nextFloat() * 350f
|
||||
vx[i] = (rand.nextFloat() - 0.5f) * 5f
|
||||
vy[i] = 3.5f + rand.nextFloat() * 7f
|
||||
y[i] = -30f - rand.nextFloat() * 300f
|
||||
vx[i] = (rand.nextFloat() - 0.5f) * 6f
|
||||
vy[i] = 7.0f + rand.nextFloat() * 12f
|
||||
size[i] = 12f + rand.nextFloat() * 16f
|
||||
colorIndex[i] = rand.nextInt(CONFETTI_COLORS.size)
|
||||
flutterPhase[i] = rand.nextFloat() * 6.28f
|
||||
@@ -62,7 +62,7 @@ fun ConfettiParticleCanvas(
|
||||
animProgress.animateTo(
|
||||
targetValue = 1f,
|
||||
animationSpec = tween(
|
||||
durationMillis = 3800,
|
||||
durationMillis = 2000, // 딱 2.0초로 설정
|
||||
easing = LinearEasing
|
||||
)
|
||||
)
|
||||
@@ -74,7 +74,7 @@ fun ConfettiParticleCanvas(
|
||||
Canvas(modifier = modifier.fillMaxSize()) {
|
||||
val canvasWidth = size.width
|
||||
val canvasHeight = size.height
|
||||
val elapsedSec = progress * 3.8f
|
||||
val elapsedSec = progress * 2.0f
|
||||
|
||||
val globalAlpha = if (progress > 0.82f) {
|
||||
((1f - progress) / 0.18f).coerceIn(0f, 1f)
|
||||
@@ -85,10 +85,10 @@ fun ConfettiParticleCanvas(
|
||||
if (globalAlpha <= 0f) return@Canvas
|
||||
|
||||
for (i in 0 until system.count) {
|
||||
// 수학 공식으로 위치 계산 (매 프레임 객체 생성 0개)
|
||||
val flutterX = sin(elapsedSec * 3.5f + system.flutterPhase[i]) * 18f
|
||||
// 2.0초 내에 화면 아래까지 가볍고 부드럽게 완전 낙하
|
||||
val flutterX = sin(elapsedSec * 4.8f + system.flutterPhase[i]) * 18f
|
||||
val px = ((system.x[i] + system.vx[i] * elapsedSec * 30f + flutterX) / 1000f) * canvasWidth
|
||||
val py = ((system.y[i] + system.vy[i] * elapsedSec * 35f + 0.5f * 9.8f * elapsedSec * elapsedSec * 15f) / 1000f) * canvasHeight
|
||||
val py = ((system.y[i] + system.vy[i] * elapsedSec * 50f + 0.5f * 18f * elapsedSec * elapsedSec * 15f) / 1000f) * canvasHeight
|
||||
|
||||
if (py < -20f || py > canvasHeight + 50f) continue
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ import kotlinx.coroutines.delay
|
||||
@Composable
|
||||
fun GameScreen(
|
||||
stageNumber: Int,
|
||||
isSelectionMode: Boolean = false,
|
||||
onNavigateBack: () -> Unit,
|
||||
onNavigateToNextStage: (Int) -> Unit,
|
||||
viewModel: GameViewModel = viewModel()
|
||||
@@ -42,8 +43,8 @@ fun GameScreen(
|
||||
val activity = context as? Activity
|
||||
val lifecycleOwner = LocalLifecycleOwner.current
|
||||
|
||||
LaunchedEffect(stageNumber) {
|
||||
viewModel.loadStage(stageNumber)
|
||||
LaunchedEffect(stageNumber, isSelectionMode) {
|
||||
viewModel.loadStage(stageNumber, isSelectionMode)
|
||||
SoundManager.playPuzzleBgm(context, stageNumber)
|
||||
}
|
||||
|
||||
@@ -69,11 +70,11 @@ fun GameScreen(
|
||||
}
|
||||
}
|
||||
|
||||
// 클리어 이벤트 수신: 참 잘했어요 도장과 폭죽 연출이 바닥까지 완전히 떨어지도록 3.8초 딜레이 후 전환
|
||||
// 클리어 이벤트 수신: 참 잘했어요 도장과 폭죽 연출을 2.0초간 보여준 후 다음 스테이지로 전환
|
||||
LaunchedEffect(Unit) {
|
||||
viewModel.stageClearEvent.collect { event ->
|
||||
// 종이가 완전히 떨어지는 애니메이션을 위한 3.8초 딜레이
|
||||
delay(3800L)
|
||||
// 종이가 바닥으로 완전히 떨어지는 2.0초 딜레이
|
||||
delay(2000L)
|
||||
|
||||
if (event.isLastStage) {
|
||||
ToastUtils.showTopToast(context, "🎉 모든 스테이지를 클리어하셨습니다!")
|
||||
@@ -265,10 +266,18 @@ fun GameScreen(
|
||||
)
|
||||
}
|
||||
|
||||
// 스테이지 클리어 세레모니 연출 (Confetti 폭죽 + 참 잘했어요! 도장)
|
||||
// 스테이지 클리어 세레모니 연출 (Confetti 폭죽 + 퍼즐 위치로 위로 끌어올린 도장 오버레이)
|
||||
if (uiState.isStageClear) {
|
||||
ConfettiParticleCanvas(particleCount = 80)
|
||||
StageClearStampOverlay(stageNumber = stageNumber)
|
||||
ConfettiParticleCanvas(particleCount = 45)
|
||||
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.offset(y = (-75).dp), // 기존 UI 배치 유지 및 도장 오버레이 위치만 퍼즐 보드 한가운데로 상향 조절
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
StageClearStampOverlay(stageNumber = stageNumber)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,6 +59,7 @@ class GameViewModel(application: Application) : AndroidViewModel(application) {
|
||||
private var isTimerPaused: Boolean = false
|
||||
|
||||
private var cleanTemplateGrid: List<List<CrosswordCell>>? = null
|
||||
private var isSelectionMode: Boolean = false
|
||||
|
||||
init {
|
||||
viewModelScope.launch {
|
||||
@@ -90,8 +91,12 @@ class GameViewModel(application: Application) : AndroidViewModel(application) {
|
||||
!state.showHintDialog
|
||||
}
|
||||
|
||||
fun loadStage(stageNumber: Int) {
|
||||
fun loadStage(stageNumber: Int, isSelectionMode: Boolean = false) {
|
||||
this.isSelectionMode = isSelectionMode
|
||||
viewModelScope.launch {
|
||||
// 플레이 한 스테이지는 최고 해금 스테이지 기록에 반영
|
||||
prefs.updateStageProgress(stageNumber)
|
||||
|
||||
_uiState.update { it.copy(isLoading = true, isStageClear = false, isStageFailed = false) }
|
||||
|
||||
val template = stageRepo.getCleanStageTemplate(stageNumber)
|
||||
@@ -351,7 +356,14 @@ class GameViewModel(application: Application) : AndroidViewModel(application) {
|
||||
viewModelScope.launch {
|
||||
val elapsedSeconds = getEffectiveElapsedSeconds()
|
||||
|
||||
prefs.setStageCleared(stage.stageNumber)
|
||||
// 클리어한 스테이지는 최고 해금 스테이지 기록에 반영
|
||||
prefs.updateStageProgress(stage.stageNumber, isCleared = true)
|
||||
|
||||
// 선택하기 모드가 아닐 때만(새로하기/이어하기 순차 진행 시) 이어하기 저장 스테이지 갱신
|
||||
if (!isSelectionMode) {
|
||||
prefs.updateContinueStage(stage.stageNumber + 1)
|
||||
}
|
||||
|
||||
for (clue in stage.clues) {
|
||||
wordRepo.markWordLearned(clue.word)
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@ package com.wordpuzzle.hangul.ui.game
|
||||
import androidx.compose.animation.core.Animatable
|
||||
import androidx.compose.animation.core.Spring
|
||||
import androidx.compose.animation.core.spring
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.shape.CircleShape
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
@@ -16,82 +16,125 @@ import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.rotate
|
||||
import androidx.compose.ui.draw.scale
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import com.wordpuzzle.hangul.R
|
||||
|
||||
@Composable
|
||||
fun StageClearStampOverlay(
|
||||
modifier: Modifier = Modifier,
|
||||
stageNumber: Int = 1
|
||||
) {
|
||||
// 쾅! 하고 힘차게 찍히는 중후한 스탬프 바운스 애니메이션
|
||||
val scaleAnim = remember { Animatable(2.8f) }
|
||||
val rotateAnim = remember { Animatable(-18f) }
|
||||
val alphaAnim = remember { Animatable(0f) }
|
||||
// 순간 팡! 타격 스탬프 애니메이션
|
||||
val scaleAnim = remember { Animatable(0f) }
|
||||
val rotateAnim = remember { Animatable(-6f) }
|
||||
|
||||
LaunchedEffect(Unit) {
|
||||
alphaAnim.animateTo(1f)
|
||||
scaleAnim.animateTo(
|
||||
targetValue = 1.0f,
|
||||
animationSpec = spring(
|
||||
dampingRatio = Spring.DampingRatioMediumBouncy,
|
||||
stiffness = Spring.StiffnessMediumLow
|
||||
dampingRatio = Spring.DampingRatioHighBouncy,
|
||||
stiffness = Spring.StiffnessHigh
|
||||
)
|
||||
)
|
||||
rotateAnim.animateTo(
|
||||
targetValue = -9f,
|
||||
targetValue = -3f,
|
||||
animationSpec = spring(
|
||||
dampingRatio = Spring.DampingRatioHighBouncy,
|
||||
stiffness = Spring.StiffnessMedium
|
||||
dampingRatio = Spring.DampingRatioMediumBouncy,
|
||||
stiffness = Spring.StiffnessHigh
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
Box(
|
||||
BoxWithConstraints(
|
||||
modifier = modifier.fillMaxSize(),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Surface(
|
||||
// 화면 가로 폭의 약 85% 크기로 확대 설정
|
||||
val stampWidth = this.maxWidth * 0.85f
|
||||
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.size(240.dp)
|
||||
.width(stampWidth)
|
||||
.aspectRatio(1f)
|
||||
.scale(scaleAnim.value)
|
||||
.rotate(rotateAnim.value)
|
||||
.border(6.dp, Color(0xFFC62828), CircleShape),
|
||||
shape = CircleShape,
|
||||
color = Color(0xFFFFF5F5), // 선명한 한지 인주 배경
|
||||
shadowElevation = 16.dp
|
||||
.rotate(rotateAnim.value),
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
Box(
|
||||
// 전통 낙관 도장 SVG 백그라운드 프레임 (congrats-seal_bg.svg)
|
||||
Image(
|
||||
painter = painterResource(id = R.drawable.ic_congrats_seal),
|
||||
contentDescription = "축하 도장 프레임",
|
||||
modifier = Modifier.fillMaxSize()
|
||||
)
|
||||
|
||||
// 도장 내부 프레임 중앙 흰색 영역에만 깔끔하게 정렬
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.padding(8.dp)
|
||||
.border(3.dp, Color(0xFFB71C1C), CircleShape),
|
||||
contentAlignment = Alignment.Center
|
||||
.fillMaxWidth(0.58f)
|
||||
.fillMaxHeight(0.62f)
|
||||
.padding(vertical = 2.dp, horizontal = 2.dp),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.Center
|
||||
) {
|
||||
Column(
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.Center
|
||||
// 상단 한자 어구
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(4.dp)
|
||||
) {
|
||||
Text(
|
||||
text = "祝 클리어",
|
||||
fontSize = 20.sp,
|
||||
fontWeight = FontWeight.ExtraBold,
|
||||
color = Color(0xFFB71C1C)
|
||||
)
|
||||
Spacer(modifier = Modifier.height(6.dp))
|
||||
Text(
|
||||
text = "참 잘했어요!",
|
||||
fontSize = 32.sp,
|
||||
text = "祝",
|
||||
fontSize = 18.sp,
|
||||
fontWeight = FontWeight.Black,
|
||||
color = Color(0xFFC62828)
|
||||
color = Color(0xFFA91419)
|
||||
)
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
Text(
|
||||
text = "STAGE $stageNumber",
|
||||
fontSize = 15.sp,
|
||||
fontWeight = FontWeight.ExtraBold,
|
||||
color = Color(0xFFD32F2F)
|
||||
text = "·",
|
||||
fontSize = 18.sp,
|
||||
fontWeight = FontWeight.Black,
|
||||
color = Color(0xFFA91419)
|
||||
)
|
||||
Text(
|
||||
text = "通",
|
||||
fontSize = 18.sp,
|
||||
fontWeight = FontWeight.Black,
|
||||
color = Color(0xFFA91419)
|
||||
)
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(3.dp))
|
||||
|
||||
// 중앙 1행: 참
|
||||
Text(
|
||||
text = "참",
|
||||
fontSize = 34.sp,
|
||||
fontWeight = FontWeight.Black,
|
||||
color = Color(0xFFA91419)
|
||||
)
|
||||
|
||||
// 중앙 2행: 잘했어요!
|
||||
Text(
|
||||
text = "잘했어요!",
|
||||
fontSize = 27.sp,
|
||||
fontWeight = FontWeight.Black,
|
||||
color = Color(0xFFA91419)
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(4.dp))
|
||||
|
||||
// 하단 전통 스테이지 표시
|
||||
Surface(
|
||||
shape = RoundedCornerShape(5.dp),
|
||||
color = Color(0xFFA91419)
|
||||
) {
|
||||
Text(
|
||||
text = "第 $stageNumber 章",
|
||||
modifier = Modifier.padding(horizontal = 9.dp, vertical = 2.5.dp),
|
||||
fontSize = 12.5.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
color = Color(0xFFF3DDC3)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="256dp"
|
||||
android:height="256dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
|
||||
<!-- White Background Card (congrats-seal_bg.svg) -->
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:pathData="M198.32,111.15 L811.49,111.15 A37.5,37.5 0 0,1 848.99,148.65 L848.99,777.2 A37.5,37.5 0 0,1 811.49,814.7 L198.32,814.7 A37.5,37.5 0 0,1 160.82,777.2 L160.82,148.65 A37.5,37.5 0 0,1 198.32,111.15 Z" />
|
||||
|
||||
<!-- Outer Seal Stamp Frame (Red with hollow center) -->
|
||||
<path
|
||||
android:fillColor="#A91419"
|
||||
android:fillType="evenOdd"
|
||||
android:pathData="M218,172 Q229,162 250,166 L770,166 Q792,170 796,191 L796,743 Q791,764 769,767 L252,767 Q229,763 226,742 Z M304,252 Q304,244 316,244 L706,244 Q718,245 718,257 L718,669 Q718,681 706,682 L316,682 Q304,681 304,669 Z" />
|
||||
|
||||
<!-- Inner Gold Outline 1 -->
|
||||
<path
|
||||
android:strokeColor="#F3DDC3"
|
||||
android:strokeWidth="13"
|
||||
android:pathData="M257,207 Q262,201 278,201 L741,201 Q757,204 757,220 L757,708 Q755,725 739,727 L283,727 Q266,724 265,708 Z" />
|
||||
|
||||
<!-- Inner Gold Outline 2 -->
|
||||
<path
|
||||
android:strokeColor="#F3DDC3"
|
||||
android:strokeWidth="4"
|
||||
android:pathData="M286,236 Q292,228 306,229 L713,229 Q730,231 730,247 L730,680 Q728,697 712,698 L309,698 Q292,696 292,679 Z" />
|
||||
|
||||
<!-- Corner Key Marks -->
|
||||
<path
|
||||
android:fillColor="#F3DDC3"
|
||||
android:pathData="M323,272h91v14h-75v90h-16zm378,0h-91v14h75v90h16zM323,655h91v-14h-75v-90h-16zm378,0h-91v-14h75v-90h16z" />
|
||||
|
||||
<!-- Small Ink Specks -->
|
||||
<path
|
||||
android:fillColor="#A91419"
|
||||
android:pathData="M194,319a7,7 0 1,0 0.1,0z M824,396a6,6 0 1,0 0.1,0z M208,689a5,5 0 1,0 0.1,0z M800,238l14,-7 3,12 -15,5z M782,770l10,-5 4,8 -12,6z" />
|
||||
</vector>
|
||||
@@ -13,12 +13,14 @@ datastore = "1.1.2"
|
||||
room = "2.7.0"
|
||||
ksp = "2.3.6"
|
||||
glance = "1.1.1"
|
||||
fragment = "1.8.6"
|
||||
playServicesAds = "23.6.0"
|
||||
coroutines = "1.10.1"
|
||||
gson = "2.11.0"
|
||||
firebaseBom = "33.9.0"
|
||||
|
||||
[libraries]
|
||||
androidx-fragment-ktx = { group = "androidx.fragment", name = "fragment-ktx", version.ref = "fragment" }
|
||||
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
|
||||
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
||||
androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
|
||||
|
||||
Reference in New Issue
Block a user