diff --git a/src/MarbleWorld.hx b/src/MarbleWorld.hx index e087dc59..b56f3d0b 100644 --- a/src/MarbleWorld.hx +++ b/src/MarbleWorld.hx @@ -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(); diff --git a/src/Settings.hx b/src/Settings.hx index 1bc5e3de..7d6904cd 100644 --- a/src/Settings.hx +++ b/src/Settings.hx @@ -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; }