From e1e310c162f38a99ae1a22904c1936bac9189e4b Mon Sep 17 00:00:00 2001 From: JiWoong Sul Date: Fri, 26 Dec 2025 16:12:12 +0900 Subject: [PATCH] =?UTF-8?q?fix(animation):=20=ED=8A=B9=EC=88=98=20?= =?UTF-8?q?=EC=95=A0=EB=8B=88=EB=A9=94=EC=9D=B4=EC=85=98=20=ED=94=84?= =?UTF-8?q?=EB=A0=88=EC=9E=84=20=EA=B0=84=EA=B2=A9=20=EA=B3=84=EC=82=B0=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - specialTick 카운터 추가로 프레임 간격 제어 - 200ms tick 기준 frameInterval 계산 로직 적용 - resurrection 등 특수 애니메이션 속도 정상화 --- .../game/widgets/ascii_animation_card.dart | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/lib/src/features/game/widgets/ascii_animation_card.dart b/lib/src/features/game/widgets/ascii_animation_card.dart index 37c00a8..750d79a 100644 --- a/lib/src/features/game/widgets/ascii_animation_card.dart +++ b/lib/src/features/game/widgets/ascii_animation_card.dart @@ -104,6 +104,9 @@ class _AsciiAnimationCardState extends State { // 글로벌 틱 (배경 스크롤용) int _globalTick = 0; + // 특수 애니메이션 틱 카운터 (프레임 간격 계산용) + int _specialTick = 0; + // 환경 타입 EnvironmentType _environment = EnvironmentType.forest; @@ -327,13 +330,22 @@ class _AsciiAnimationCardState extends State { _globalTick++; if (_animationMode == AnimationMode.special) { - _currentFrame++; - final maxFrames = - specialAnimationFrameCounts[_currentSpecialAnimation] ?? 5; - // 마지막 프레임에 도달하면 특수 애니메이션 종료 - if (_currentFrame >= maxFrames) { - _currentSpecialAnimation = null; - _updateAnimation(); + _specialTick++; + // 특수 애니메이션 프레임 간격 계산 (200ms tick 기준) + // 예: resurrection 600ms → 600/200 = 3 tick마다 1 프레임 + final frameInterval = + (specialAnimationFrameIntervals[_currentSpecialAnimation] ?? 200) ~/ + 200; + if (_specialTick >= frameInterval) { + _specialTick = 0; + _currentFrame++; + final maxFrames = + specialAnimationFrameCounts[_currentSpecialAnimation] ?? 5; + // 마지막 프레임에 도달하면 특수 애니메이션 종료 + if (_currentFrame >= maxFrames) { + _currentSpecialAnimation = null; + _updateAnimation(); + } } } else if (_animationMode == AnimationMode.battle) { _advanceBattleFrame(); @@ -350,6 +362,7 @@ class _AsciiAnimationCardState extends State { if (_currentSpecialAnimation != null) { _animationMode = AnimationMode.special; _currentFrame = 0; + _specialTick = 0; // 특수 애니메이션은 게임 일시정지와 무관하게 항상 재생 _startTimer();