fixed pathedinterior timings and tweaked pause bug

This commit is contained in:
RandomityGuy 2023-07-12 21:56:43 +05:30
parent bd31449cd5
commit 8f48a7b46c
3 changed files with 11 additions and 9 deletions

View file

@ -146,7 +146,7 @@ class MarbleWorld extends Scheduler {
public var totalGems:Int = 0; public var totalGems:Int = 0;
public var gemCount:Int = 0; public var gemCount:Int = 0;
public var blastAmount:Float = 0; public var blastAmount:Float = 0;
public var skipStartBug:Bool = false; public var skipStartBugPauseTime:Float = 0.0;
var renderBlastAmount:Float = 0; var renderBlastAmount:Float = 0;
@ -466,7 +466,7 @@ class MarbleWorld extends Scheduler {
this.renderBlastAmount = 0; this.renderBlastAmount = 0;
this.outOfBoundsTime = null; this.outOfBoundsTime = null;
this.finishTime = null; this.finishTime = null;
this.skipStartBug = false; this.skipStartBugPauseTime = 0.0;
this.currentCheckpoint = null; this.currentCheckpoint = null;
this.currentCheckpointTrigger = null; this.currentCheckpointTrigger = null;
@ -592,7 +592,7 @@ class MarbleWorld extends Scheduler {
if ((this.timeState.currentAttemptTime >= 0.5) && (this.timeState.currentAttemptTime < 3.5)) { if ((this.timeState.currentAttemptTime >= 0.5) && (this.timeState.currentAttemptTime < 3.5)) {
this.marble.setMode(Start); 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); this.marble.setMode(Play);
} }
} }
@ -1151,7 +1151,7 @@ class MarbleWorld extends Scheduler {
var timeMultiplier = this.gameMode.timeMultiplier(); var timeMultiplier = this.gameMode.timeMultiplier();
if (!this.isWatching) { 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; this.bonusTime -= dt;
if (this.bonusTime < 0) { if (this.bonusTime < 0) {
this.timeState.gameplayClock -= this.bonusTime * timeMultiplier; this.timeState.gameplayClock -= this.bonusTime * timeMultiplier;
@ -1166,7 +1166,7 @@ class MarbleWorld extends Scheduler {
timeTravelSound.stop(); timeTravelSound.stop();
timeTravelSound = null; timeTravelSound = null;
} }
if ((this.timeState.currentAttemptTime >= 3.5 || skipStartBug)) { if (this.timeState.currentAttemptTime + skipStartBugPauseTime >= 3.5) {
this.timeState.gameplayClock += dt * timeMultiplier; this.timeState.gameplayClock += dt * timeMultiplier;
} else if (this.timeState.currentAttemptTime + dt >= 3.5) { } else if (this.timeState.currentAttemptTime + dt >= 3.5) {
this.timeState.gameplayClock += ((this.timeState.currentAttemptTime + dt) - 3.5) * timeMultiplier; this.timeState.gameplayClock += ((this.timeState.currentAttemptTime + dt) - 3.5) * timeMultiplier;
@ -1179,7 +1179,7 @@ class MarbleWorld extends Scheduler {
this.timeState.currentAttemptTime = this.replay.currentPlaybackFrame.time; this.timeState.currentAttemptTime = this.replay.currentPlaybackFrame.time;
this.timeState.gameplayClock = this.replay.currentPlaybackFrame.clockTime; this.timeState.gameplayClock = this.replay.currentPlaybackFrame.clockTime;
this.bonusTime = this.replay.currentPlaybackFrame.bonusTime; 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) { if (timeTravelSound == null) {
var ttsnd = ResourceLoader.getResource("data/sound/timetravelactive.wav", ResourceLoader.getAudio, this.soundResources); var ttsnd = ResourceLoader.getResource("data/sound/timetravelactive.wav", ResourceLoader.getAudio, this.soundResources);
timeTravelSound = AudioManager.playSound(ttsnd, null, true); timeTravelSound = AudioManager.playSound(ttsnd, null, true);

View file

@ -233,7 +233,7 @@ class PathedInterior extends InteriorObject {
function computeDuration() { function computeDuration() {
var total = 0.0; var total = 0.0;
for (i in 0...(markerData.length - 1)) { for (i in 0...markerData.length) {
var marker = markerData[i]; var marker = markerData[i];
total += marker.msToNext; total += marker.msToNext;
} }

View file

@ -116,7 +116,9 @@ class ExitGameDlg extends GuiImage {
override function update(dt:Float, mouseState:MouseState) { override function update(dt:Float, mouseState:MouseState) {
super.update(dt, mouseState); super.update(dt, mouseState);
timeMenu += dt; timeMenu += dt;
if (timeMenu > 3) }
MarbleGame.instance.world.skipStartBug = true; // Trigger this lol
override function onRemove() {
MarbleGame.instance.world.skipStartBugPauseTime += timeMenu;
} }
} }