fix(animation): 특수 애니메이션 프레임 간격 계산 수정
- specialTick 카운터 추가로 프레임 간격 제어 - 200ms tick 기준 frameInterval 계산 로직 적용 - resurrection 등 특수 애니메이션 속도 정상화
This commit is contained in:
@@ -104,6 +104,9 @@ class _AsciiAnimationCardState extends State<AsciiAnimationCard> {
|
||||
// 글로벌 틱 (배경 스크롤용)
|
||||
int _globalTick = 0;
|
||||
|
||||
// 특수 애니메이션 틱 카운터 (프레임 간격 계산용)
|
||||
int _specialTick = 0;
|
||||
|
||||
// 환경 타입
|
||||
EnvironmentType _environment = EnvironmentType.forest;
|
||||
|
||||
@@ -327,6 +330,14 @@ class _AsciiAnimationCardState extends State<AsciiAnimationCard> {
|
||||
_globalTick++;
|
||||
|
||||
if (_animationMode == AnimationMode.special) {
|
||||
_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;
|
||||
@@ -335,6 +346,7 @@ class _AsciiAnimationCardState extends State<AsciiAnimationCard> {
|
||||
_currentSpecialAnimation = null;
|
||||
_updateAnimation();
|
||||
}
|
||||
}
|
||||
} else if (_animationMode == AnimationMode.battle) {
|
||||
_advanceBattleFrame();
|
||||
}
|
||||
@@ -350,6 +362,7 @@ class _AsciiAnimationCardState extends State<AsciiAnimationCard> {
|
||||
if (_currentSpecialAnimation != null) {
|
||||
_animationMode = AnimationMode.special;
|
||||
_currentFrame = 0;
|
||||
_specialTick = 0;
|
||||
|
||||
// 특수 애니메이션은 게임 일시정지와 무관하게 항상 재생
|
||||
_startTimer();
|
||||
|
||||
Reference in New Issue
Block a user