mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
respawn key
This commit is contained in:
parent
6f47c50e2a
commit
22047323c8
1 changed files with 16 additions and 0 deletions
|
|
@ -133,6 +133,8 @@ class MarbleWorld extends Scheduler {
|
|||
var helpTextTimeState:Float = -1e8;
|
||||
var alertTextTimeState:Float = -1e8;
|
||||
|
||||
var respawnPressedTime:Float = -1e8;
|
||||
|
||||
// Orientation
|
||||
var orientationChangeTime = -1e8;
|
||||
var oldOrientationQuat = new Quat();
|
||||
|
|
@ -975,6 +977,20 @@ class MarbleWorld extends Scheduler {
|
|||
ProfilerUI.measure("updateTimer");
|
||||
this.updateTimer(dt);
|
||||
|
||||
if (Key.isPressed(Settings.controlsSettings.respawn)) {
|
||||
this.respawnPressedTime = timeState.timeSinceLoad;
|
||||
this.restart();
|
||||
return;
|
||||
}
|
||||
|
||||
if (Key.isDown(Settings.controlsSettings.respawn)) {
|
||||
if (timeState.timeSinceLoad - this.respawnPressedTime > 1.5) {
|
||||
this.restart(true);
|
||||
this.respawnPressedTime = Math.POSITIVE_INFINITY;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.tickSchedule(timeState.currentAttemptTime);
|
||||
this.updateGameState();
|
||||
ProfilerUI.measure("updateDTS");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue