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

View file

@ -74,7 +74,8 @@ class RewindFrame {
} }
c.oobState = { c.oobState = {
oob: oobState.oob, 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]; var topFrame = frames[frames.length - 1];
while (topFrame.timeState.currentAttemptTime > absTime) { while (topFrame.timeState.currentAttemptTime > absTime) {
if (frames.length == 1) {
return frames[0];
}
frames.pop(); frames.pop();
if (frames.length == 0) if (frames.length == 0)
return null; return null;