actually fix those bugs-

This commit is contained in:
RandomityGuy 2023-06-04 22:23:01 +05:30
parent 6ddd704a3f
commit 3a13105d61
3 changed files with 9 additions and 1 deletions

View file

@ -470,12 +470,15 @@ class MarbleWorld extends Scheduler {
return; // We will update state manually
if (this.timeState.currentAttemptTime < 0.5) {
this.playGui.setCenterText('none');
this.marble.mode = Start;
}
if ((this.timeState.currentAttemptTime >= 0.5) && (this.timeState.currentAttemptTime < 2)) {
this.playGui.setCenterText('ready');
this.marble.mode = Start;
}
if ((this.timeState.currentAttemptTime >= 2) && (this.timeState.currentAttemptTime < 3.5)) {
this.playGui.setCenterText('set');
this.marble.mode = Start;
}
if ((this.timeState.currentAttemptTime >= 3.5) && (this.timeState.currentAttemptTime < 5.5)) {
this.playGui.setCenterText('go');
@ -483,6 +486,7 @@ class MarbleWorld extends Scheduler {
}
if (this.timeState.currentAttemptTime >= 5.5) {
this.playGui.setCenterText('none');
this.marble.mode = Play;
}
}

View file

@ -74,7 +74,8 @@ class RewindFrame {
}
c.oobState = {
oob: oobState.oob,
timeState: oobState.timeState.clone()
timeState: oobState.timeState != null ? oobState.timeState.clone() : null
};
return c;
}
}

View file

@ -184,6 +184,9 @@ class RewindManager {
var topFrame = frames[frames.length - 1];
while (topFrame.timeState.currentAttemptTime > absTime) {
if (frames.length == 1) {
return frames[0];
}
frames.pop();
if (frames.length == 0)
return null;