classier end
This commit is contained in:
11
main.js
11
main.js
@@ -453,8 +453,7 @@ function playerCollisions() {
|
||||
|
||||
if ( !escaped && raftOctree.capsuleIntersect( playerCollider ) ) {
|
||||
|
||||
escaped = true;
|
||||
alert("Congrats! You finally escaped.");
|
||||
end.className = "escaped";
|
||||
|
||||
}
|
||||
|
||||
@@ -478,6 +477,12 @@ function playerCollisions() {
|
||||
|
||||
}
|
||||
|
||||
addEventListener("animationend", (event) => {
|
||||
escaped = true;
|
||||
document.exitPointerLock();
|
||||
});
|
||||
|
||||
|
||||
function updatePlayer( deltaTime ) {
|
||||
|
||||
let damping = Math.exp( - 4 * deltaTime ) - 1;
|
||||
@@ -627,6 +632,6 @@ function animate() {
|
||||
|
||||
if ( showStats ) stats.update();
|
||||
|
||||
requestAnimationFrame( animate );
|
||||
if ( !escaped ) requestAnimationFrame( animate );
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user