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();