do the fixes

This commit is contained in:
RandomityGuy 2023-07-16 19:20:19 +05:30
parent 4e20125a2d
commit 2f81f5e137
4 changed files with 19 additions and 14 deletions

View file

@ -1078,7 +1078,7 @@ class MarbleWorld extends Scheduler {
if (this.outOfBounds
&& this.finishTime == null
&& (Key.isDown(Settings.controlsSettings.powerup) || Gamepad.isDown(Settings.gamepadSettings.powerup))
&& (Key.isDown(Settings.controlsSettings.jump) || Gamepad.isDown(Settings.gamepadSettings.jump))
&& !this.isWatching) {
this.restart();
return;
@ -1549,8 +1549,10 @@ class MarbleWorld extends Scheduler {
/** Get the current interpolated orientation quaternion. */
public function getOrientationQuat(time:Float) {
var completion = Util.clamp((time - this.orientationChangeTime) / 0.8, 0, 1);
var newDt = completion / 0.4 * 2.302585124969482;
var newDt = completion / 0.15;
var smooth = 1.0 / (newDt * (newDt * 0.235 * newDt) + newDt + 1.0 + 0.48 * newDt * newDt);
if (completion > 0.9)
smooth = Util.lerp(25.0 / 1876.0, 0, (completion - 0.9) * 10);
var q = this.oldOrientationQuat.clone();
q.slerp(q, this.newOrientationQuat, 1 - smooth);
return q;
@ -1641,10 +1643,8 @@ class MarbleWorld extends Scheduler {
/** Sets a new active checkpoint. */
public function saveCheckpointState(shape:DtsObject, trigger:CheckpointTrigger = null) {
if (this.currentCheckpoint != null)
if (this.currentCheckpoint == shape)
return false;
var disableOob = false;
var isSame = this.currentCheckpoint == shape;
if (trigger != null) {
disableOob = trigger.disableOOB;
if (checkpointSequence > trigger.seqNum)
@ -1664,7 +1664,9 @@ class MarbleWorld extends Scheduler {
this.checkpointCollectedGems.set(gem, true);
}
this.checkpointHeldPowerup = this.marble.heldPowerup;
AudioManager.playSound(ResourceLoader.getResource('data/sound/checkpoint.wav', ResourceLoader.getAudio, this.soundResources));
if (!isSame) {
AudioManager.playSound(ResourceLoader.getResource('data/sound/checkpoint.wav', ResourceLoader.getAudio, this.soundResources));
}
return true;
}

View file

@ -148,12 +148,12 @@ class Settings {
camRight: Key.RIGHT,
jump: Key.SPACE,
powerup: Key.MOUSE_LEFT,
freelook: Key.MOUSE_RIGHT,
freelook: Key.MOUSE_MIDDLE,
alwaysFreeLook: true,
cameraSensitivity: 0.6,
invertYAxis: false,
respawn: Key.BACKSPACE,
blast: Key.E,
blast: Key.MOUSE_RIGHT,
rewind: Key.R,
};

View file

@ -119,11 +119,10 @@ class CollisionWorld {
public function removeMovingEntity(entity:CollisionEntity) {
this.dynamicEntities.remove(entity);
this.dynamicOctree.remove(entity);
this.dynamicEntitySet.remove(entity);
}
public function updateTransform(entity:CollisionEntity) {
this.octree.update(entity);
this.dynamicBVH.update();
}
}

View file

@ -36,11 +36,15 @@ class CheckpointTrigger extends Trigger {
if (shape.length == 0)
return;
var chk:Checkpoint = cast shape[0];
var prevChk = @:privateAccess this.level.currentCheckpoint;
var issame = prevChk == chk;
if (this.level.saveCheckpointState(chk, this)) {
chk.lastActivatedTime = time.timeSinceLoad;
for (obj in this.level.dtsObjects) {
if (obj.identifier == "Checkpoint" && obj != chk)
cast(obj, Checkpoint).lastActivatedTime = Math.POSITIVE_INFINITY;
if (!issame) {
chk.lastActivatedTime = time.timeSinceLoad;
for (obj in this.level.dtsObjects) {
if (obj.identifier == "Checkpoint" && obj != chk)
cast(obj, Checkpoint).lastActivatedTime = Math.POSITIVE_INFINITY;
}
}
}
}