Fix: Add buffer delay to Enemy Turn for animation sync
This commit is contained in:
parent
1720725826
commit
3030c09d55
|
|
@ -495,7 +495,8 @@ class BattleProvider with ChangeNotifier {
|
||||||
if (intent.risk == RiskLevel.safe) delay = GameConfig.animDelaySafe;
|
if (intent.risk == RiskLevel.safe) delay = GameConfig.animDelaySafe;
|
||||||
if (intent.risk == RiskLevel.risky) delay = GameConfig.animDelayRisky;
|
if (intent.risk == RiskLevel.risky) delay = GameConfig.animDelayRisky;
|
||||||
|
|
||||||
await Future.delayed(Duration(milliseconds: delay));
|
// Add small buffer to ensure visual impact happens before text (300ms)
|
||||||
|
await Future.delayed(Duration(milliseconds: delay + 300));
|
||||||
|
|
||||||
int incomingDamage = intent.finalValue;
|
int incomingDamage = intent.finalValue;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
# 65. Fix Floating Text Timing
|
||||||
|
|
||||||
|
## 1. 목표 (Goal)
|
||||||
|
- 적이 플레이어에게 도착하기도 전에 데미지 텍스트가 먼저 뜨는 문제를 해결합니다.
|
||||||
|
|
||||||
|
## 2. 원인 (Cause)
|
||||||
|
- `BattleProvider`에서 주는 `Future.delayed` 시간이 실제 UI 상의 '적 돌진 애니메이션 소요 시간'보다 짧거나 비슷하여, 미세한 차이로 `DamageEvent`가 먼저 처리됨.
|
||||||
|
|
||||||
|
## 3. 해결 방안 (Solution)
|
||||||
|
- `BattleProvider`의 `_enemyTurn` 메서드에서 사용하는 딜레이 시간에 **여유분(+300ms)**을 추가하여, 확실하게 애니메이션이 타격 지점에 도달한 후에 데미지 이벤트가 발생하도록 조정합니다.
|
||||||
|
|
||||||
|
## 4. 기대 효과 (Expected Outcome)
|
||||||
|
- 적이 돌진 -> 타격(Impact) -> 그 순간에 데미지 텍스트 출력 순서가 자연스럽게 맞음.
|
||||||
Loading…
Reference in New Issue