T to restart - request

This commit is contained in:
RandomityGuy 2024-08-02 01:37:42 +05:30
parent 8416ad018f
commit 11f84e8d81
2 changed files with 13 additions and 0 deletions

View file

@ -974,6 +974,11 @@ class MarbleWorld extends Scheduler {
ProfilerUI.measure("updateTimer");
this.updateTimer(dt);
if ((Key.isPressed(Settings.controlsSettings.respawn)) && this.finishTime == null) {
this.restart();
return;
}
this.tickSchedule(timeState.currentAttemptTime);
this.updateGameState();

View file

@ -53,6 +53,7 @@ typedef ControlsSettings = {
var cameraSensitivity:Float;
var invertYAxis:Bool;
var rewind:Int;
var respawn:Int;
}
typedef TouchSettings = {
@ -118,6 +119,7 @@ class Settings {
cameraSensitivity: 0.6,
invertYAxis: false,
rewind: Key.R,
respawn: Key.T,
};
public static var touchSettings:TouchSettings = {
@ -270,6 +272,9 @@ class Settings {
if (controlsSettings.rewind == 0) {
controlsSettings.rewind = Key.R;
}
if (controlsSettings.respawn == 0) {
controlsSettings.respawn = Key.T;
}
if (touchSettings.rewindButtonPos == null) {
touchSettings.rewindButtonPos = [380, 240];
touchSettings.rewindButtonSize = 60;
@ -284,6 +289,9 @@ class Settings {
if (controlsSettings.rewind == null) {
controlsSettings.rewind = Key.R;
}
if (controlsSettings.respawn == null) {
controlsSettings.respawn = Key.T;
}
if (optionsSettings.rewindEnabled == null) {
optionsSettings.rewindEnabled = false;
}