Skip to content

Commit

Permalink
Fix incorrect frame counting in credits
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislo27 committed Oct 5, 2020
1 parent 1d9d95c commit a2c8b9e
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit a2c8b9e

Please sign in to comment.