diff --git a/src/MarbleWorld.hx b/src/MarbleWorld.hx index 71d51343..bb638a29 100644 --- a/src/MarbleWorld.hx +++ b/src/MarbleWorld.hx @@ -147,7 +147,7 @@ class MarbleWorld extends Scheduler { public var totalGems:Int = 0; public var gemCount:Int = 0; public var blastAmount:Float = 0; - public var skipStartBug:Bool = false; + public var skipStartBugPauseTime:Float = 0.0; var renderBlastAmount:Float = 0; @@ -467,7 +467,7 @@ class MarbleWorld extends Scheduler { this.renderBlastAmount = 0; this.outOfBoundsTime = null; this.finishTime = null; - this.skipStartBug = false; + this.skipStartBugPauseTime = 0.0; this.currentCheckpoint = null; this.currentCheckpointTrigger = null; @@ -593,7 +593,7 @@ class MarbleWorld extends Scheduler { if ((this.timeState.currentAttemptTime >= 0.5) && (this.timeState.currentAttemptTime < 3.5)) { this.marble.setMode(Start); } - if ((this.timeState.currentAttemptTime >= 3.5 || skipStartBug) && this.finishTime == null) { + if (this.timeState.currentAttemptTime + skipStartBugPauseTime >= 3.5 && this.finishTime == null) { this.marble.setMode(Play); } } @@ -1152,7 +1152,7 @@ class MarbleWorld extends Scheduler { var timeMultiplier = this.gameMode.timeMultiplier(); if (!this.isWatching) { - if (this.bonusTime != 0 && (this.timeState.currentAttemptTime >= 3.5 || skipStartBug)) { + if (this.bonusTime != 0 && this.timeState.currentAttemptTime + skipStartBugPauseTime >= 3.5) { this.bonusTime -= dt; if (this.bonusTime < 0) { this.timeState.gameplayClock -= this.bonusTime * timeMultiplier; @@ -1167,7 +1167,7 @@ class MarbleWorld extends Scheduler { timeTravelSound.stop(); timeTravelSound = null; } - if ((this.timeState.currentAttemptTime >= 3.5 || skipStartBug)) { + if (this.timeState.currentAttemptTime + skipStartBugPauseTime >= 3.5) { this.timeState.gameplayClock += dt * timeMultiplier; } else if (this.timeState.currentAttemptTime + dt >= 3.5) { this.timeState.gameplayClock += ((this.timeState.currentAttemptTime + dt) - 3.5) * timeMultiplier; @@ -1180,7 +1180,7 @@ class MarbleWorld extends Scheduler { this.timeState.currentAttemptTime = this.replay.currentPlaybackFrame.time; this.timeState.gameplayClock = this.replay.currentPlaybackFrame.clockTime; this.bonusTime = this.replay.currentPlaybackFrame.bonusTime; - if (this.bonusTime != 0 && (this.timeState.currentAttemptTime >= 3.5 || skipStartBug)) { + if (this.bonusTime != 0 && this.timeState.currentAttemptTime + skipStartBugPauseTime >= 3.5) { if (timeTravelSound == null) { var ttsnd = ResourceLoader.getResource("data/sound/timetravelactive.wav", ResourceLoader.getAudio, this.soundResources); timeTravelSound = AudioManager.playSound(ttsnd, null, true); diff --git a/src/PathedInterior.hx b/src/PathedInterior.hx index d81a1f1b..7d5f653f 100644 --- a/src/PathedInterior.hx +++ b/src/PathedInterior.hx @@ -233,7 +233,7 @@ class PathedInterior extends InteriorObject { function computeDuration() { var total = 0.0; - for (i in 0...(markerData.length - 1)) { + for (i in 0...markerData.length) { var marker = markerData[i]; total += marker.msToNext; } diff --git a/src/gui/ExitGameDlg.hx b/src/gui/ExitGameDlg.hx index e651783b..d3341e02 100644 --- a/src/gui/ExitGameDlg.hx +++ b/src/gui/ExitGameDlg.hx @@ -116,7 +116,9 @@ class ExitGameDlg extends GuiImage { override function update(dt:Float, mouseState:MouseState) { super.update(dt, mouseState); timeMenu += dt; - if (timeMenu > 3) - MarbleGame.instance.world.skipStartBug = true; // Trigger this lol + } + + override function onRemove() { + MarbleGame.instance.world.skipStartBugPauseTime += timeMenu; } }