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 _globalTick = 0;
|
||||||
|
|
||||||
|
// 특수 애니메이션 틱 카운터 (프레임 간격 계산용)
|
||||||
|
int _specialTick = 0;
|
||||||
|
|
||||||
// 환경 타입
|
// 환경 타입
|
||||||
EnvironmentType _environment = EnvironmentType.forest;
|
EnvironmentType _environment = EnvironmentType.forest;
|
||||||
|
|
||||||
@@ -327,13 +330,22 @@ class _AsciiAnimationCardState extends State<AsciiAnimationCard> {
|
|||||||
_globalTick++;
|
_globalTick++;
|
||||||
|
|
||||||
if (_animationMode == AnimationMode.special) {
|
if (_animationMode == AnimationMode.special) {
|
||||||
_currentFrame++;
|
_specialTick++;
|
||||||
final maxFrames =
|
// 특수 애니메이션 프레임 간격 계산 (200ms tick 기준)
|
||||||
specialAnimationFrameCounts[_currentSpecialAnimation] ?? 5;
|
// 예: resurrection 600ms → 600/200 = 3 tick마다 1 프레임
|
||||||
// 마지막 프레임에 도달하면 특수 애니메이션 종료
|
final frameInterval =
|
||||||
if (_currentFrame >= maxFrames) {
|
(specialAnimationFrameIntervals[_currentSpecialAnimation] ?? 200) ~/
|
||||||
_currentSpecialAnimation = null;
|
200;
|
||||||
_updateAnimation();
|
if (_specialTick >= frameInterval) {
|
||||||
|
_specialTick = 0;
|
||||||
|
_currentFrame++;
|
||||||
|
final maxFrames =
|
||||||
|
specialAnimationFrameCounts[_currentSpecialAnimation] ?? 5;
|
||||||
|
// 마지막 프레임에 도달하면 특수 애니메이션 종료
|
||||||
|
if (_currentFrame >= maxFrames) {
|
||||||
|
_currentSpecialAnimation = null;
|
||||||
|
_updateAnimation();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (_animationMode == AnimationMode.battle) {
|
} else if (_animationMode == AnimationMode.battle) {
|
||||||
_advanceBattleFrame();
|
_advanceBattleFrame();
|
||||||
@@ -350,6 +362,7 @@ class _AsciiAnimationCardState extends State<AsciiAnimationCard> {
|
|||||||
if (_currentSpecialAnimation != null) {
|
if (_currentSpecialAnimation != null) {
|
||||||
_animationMode = AnimationMode.special;
|
_animationMode = AnimationMode.special;
|
||||||
_currentFrame = 0;
|
_currentFrame = 0;
|
||||||
|
_specialTick = 0;
|
||||||
|
|
||||||
// 특수 애니메이션은 게임 일시정지와 무관하게 항상 재생
|
// 특수 애니메이션은 게임 일시정지와 무관하게 항상 재생
|
||||||
_startTimer();
|
_startTimer();
|
||||||
|
|||||||
Reference in New Issue
Block a user