characters invisible on human vs bot fight entrance fix

This commit is contained in:
Dorian
2026-03-11 09:17:20 +00:00
parent bcbcd17fce
commit 974566778e
3 changed files with 39 additions and 7 deletions
+6
View File
@@ -49,6 +49,7 @@ const {
roundCooldown, pendingChallengeData,
applyChallenge, submitChoice, startHumanPolling, stopHumanPolling,
startCooldown, clearChallenge, resetState: resetChallengeState, handleSSEChallenge,
setEntrancePlaying,
} = challenge
// Live scene state
@@ -155,6 +156,10 @@ async function initLiveScene() {
await ensureAudioContext()
liveScene.startMusic()
}
// Let Kaplay register game objects before entrance (prevents invisible fighters)
await new Promise(r => requestAnimationFrame(() => requestAnimationFrame(r)))
// Block challenges during entrance so the animation plays fully
setEntrancePlaying(true)
announceDeepIntro()
try {
await liveScene.playEntrance()
@@ -163,6 +168,7 @@ async function initLiveScene() {
}
// Safety: ensure fighters are visible after entrance (prevents invisible characters on mobile)
liveScene._resetPositions()
setEntrancePlaying(false)
}
liveLogItems.value.push(