Compare commits
No commits in common. "af8befcf72034317502c31e9ee9de17b5d208cc1" and "cdadb7d42e8d5521041a3ed1461c482aae857fa0" have entirely different histories.
af8befcf72
...
cdadb7d42e
BIN
img/wall.jpg
BIN
img/wall.jpg
Binary file not shown.
Before Width: | Height: | Size: 2.1 MiB After Width: | Height: | Size: 1.8 MiB |
14
main.js
14
main.js
@ -471,12 +471,9 @@ document.addEventListener('keyup', (event) => {
|
|||||||
|
|
||||||
function playerCollisions() {
|
function playerCollisions() {
|
||||||
|
|
||||||
if (raftOctree.capsuleIntersect(playerCollider)) {
|
if (!escaped && raftOctree.capsuleIntersect(playerCollider)) {
|
||||||
|
|
||||||
|
gameEnd()
|
||||||
camera.position.y = raft.position.y + 0.9;
|
|
||||||
|
|
||||||
if (!escaped) gameEnd()
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -699,9 +696,6 @@ function animate() {
|
|||||||
const delta = Math.min(0.05, clock.getDelta())
|
const delta = Math.min(0.05, clock.getDelta())
|
||||||
const deltaTime = delta / STEPS_PER_FRAME;
|
const deltaTime = delta / STEPS_PER_FRAME;
|
||||||
|
|
||||||
ocean.material.uniforms['time'].value += delta;
|
|
||||||
updateRaft(delta);
|
|
||||||
|
|
||||||
// we look for collisions in substeps to mitigate the risk of
|
// we look for collisions in substeps to mitigate the risk of
|
||||||
// an object traversing another too quickly for detection.
|
// an object traversing another too quickly for detection.
|
||||||
|
|
||||||
@ -718,6 +712,10 @@ function animate() {
|
|||||||
if (camera.position.y > 3.5)
|
if (camera.position.y > 3.5)
|
||||||
camera.lookAt(raft.position.x, raft.position.y, raft.position.z);
|
camera.lookAt(raft.position.x, raft.position.y, raft.position.z);
|
||||||
|
|
||||||
|
ocean.material.uniforms['time'].value += delta;
|
||||||
|
updateRaft(delta);
|
||||||
|
if (escaped) camera.position.y = raft.position.y + 0.9;
|
||||||
|
|
||||||
renderer.render(scene, camera);
|
renderer.render(scene, camera);
|
||||||
|
|
||||||
if (showStats) stats.update();
|
if (showStats) stats.update();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user