/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* multiLocalGamePage.js :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: edbernar { if (child.geometry) child.geometry.dispose(); if (child.material) child.material.dispose(); if (child.texture) child.texture.dispose(); scene.remove(child); }); } scene = null; } }; // ///////////// // const fps = 10; // change to 30 for 30 fps // const frameDuration = 1000 / fps; // let lastTime = 0; // ///////////// function loop(timestamp) // retirer timestamp { if (gameEndStatus) { renderer.setAnimationLoop(null); gameFinish() } // const deltaTime = timestamp - lastTime; // // if (deltaTime >= frameDuration)// // { // lastTime = timestamp;// // Ball.update(); Map.update(); Players.update(); if (renderer) { renderer.render(scene, camera); } // } } function gameFinish() { scoreElement.innerHTML = "Player " + (score.player1 > score.player2 ? "1" : "2") + " win !"; scoreElement.style.fontSize = '10vh'; scoreElement.style.opacity = 1; document.body.style.animation = 'none'; setTimeout(() => { document.body.style.animation = 'end 1s'; setTimeout(() => { pageRenderer.changePage('lobbyPage'); }, 500); }, 3000); } function windowUpdater() { renderer.setSize(window.innerWidth, window.innerHeight); camera.aspect = window.innerWidth / window.innerHeight; camera.updateProjectionMatrix(); }; export { multiLocalGamePage };