Compare commits
No commits in common. "ee36c2d8fb650581e583a5f2bba28b8a503403f5" and "97ac1cad0bd3540a10054865c0a7736d88966d8d" have entirely different histories.
ee36c2d8fb
...
97ac1cad0b
@ -9,7 +9,6 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="container"></div>
|
<div id="container"></div>
|
||||||
<span id="end">Libre</span>
|
|
||||||
|
|
||||||
<!-- Import maps polyfill -->
|
<!-- Import maps polyfill -->
|
||||||
<!-- Remove this when import maps will be widely supported -->
|
<!-- Remove this when import maps will be widely supported -->
|
||||||
|
11
main.js
11
main.js
@ -453,7 +453,8 @@ function playerCollisions() {
|
|||||||
|
|
||||||
if ( !escaped && raftOctree.capsuleIntersect( playerCollider ) ) {
|
if ( !escaped && raftOctree.capsuleIntersect( playerCollider ) ) {
|
||||||
|
|
||||||
end.className = "escaped";
|
escaped = true;
|
||||||
|
alert("Congrats! You finally escaped.");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -477,12 +478,6 @@ function playerCollisions() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
addEventListener("animationend", (event) => {
|
|
||||||
escaped = true;
|
|
||||||
document.exitPointerLock();
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
function updatePlayer( deltaTime ) {
|
function updatePlayer( deltaTime ) {
|
||||||
|
|
||||||
let damping = Math.exp( - 4 * deltaTime ) - 1;
|
let damping = Math.exp( - 4 * deltaTime ) - 1;
|
||||||
@ -632,6 +627,6 @@ function animate() {
|
|||||||
|
|
||||||
if ( showStats ) stats.update();
|
if ( showStats ) stats.update();
|
||||||
|
|
||||||
if ( !escaped ) requestAnimationFrame( animate );
|
requestAnimationFrame( animate );
|
||||||
|
|
||||||
}
|
}
|
36
style.css
36
style.css
@ -8,39 +8,3 @@ body {
|
|||||||
overscroll-behavior: none;
|
overscroll-behavior: none;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
canvas {
|
|
||||||
position: absolute;
|
|
||||||
z-index: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes escaped{
|
|
||||||
0% {
|
|
||||||
opacity: 0%;
|
|
||||||
background: transparent;
|
|
||||||
height: 10vh;
|
|
||||||
padding-top: 90vh;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#end {
|
|
||||||
display: none;
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100vh;
|
|
||||||
font-size: 10vh;
|
|
||||||
font-family: Georgia, serif;
|
|
||||||
color: gray;
|
|
||||||
justify-content: center;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#end.escaped {
|
|
||||||
display: flex;
|
|
||||||
animation: escaped 5s;
|
|
||||||
height: 50vh;
|
|
||||||
padding-top: 50vh;
|
|
||||||
opacity: 100%;
|
|
||||||
background: white;
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user