diff --git a/core/src/main/kotlin/io/github/chrislo27/rhre3/credits/CreditsGame.kt b/core/src/main/kotlin/io/github/chrislo27/rhre3/credits/CreditsGame.kt index 03f10b0c2..f03e6f5d6 100644 --- a/core/src/main/kotlin/io/github/chrislo27/rhre3/credits/CreditsGame.kt +++ b/core/src/main/kotlin/io/github/chrislo27/rhre3/credits/CreditsGame.kt @@ -204,6 +204,7 @@ class CreditsGame(main: RHRE3Application, val speedMultiplier: Float = 1f) private var dancersFaceState = TimedDanceState(0, D_FACE) private var vocalistFaceState = TimedDanceState(0, D_FACE) private var leadFaceState = TimedDanceState(0, D_FACE) + private var frameWait: Float = 0f private var currentFrame: Int = 0 private var frameUsedSax: Int = 0 @@ -563,7 +564,12 @@ class CreditsGame(main: RHRE3Application, val speedMultiplier: Float = 1f) } } - currentFrame++ + frameWait += delta + val sixtieth = 1 / 60f + while (frameWait > sixtieth) { + frameWait -= sixtieth + currentFrame++ + } if (currentFrame - dancersState.startFrame >= dancersState.danceState.durationFrames + dancersState.linger) { dancersState = TimedDanceState(currentFrame, D_READY) }