- update color tv
    - move spotlight on home page
    - starting ranked mod
This commit is contained in:
Kum1ta
2024-10-01 02:37:25 +02:00
parent e82bbbc880
commit 709d0cb25a
4 changed files with 21 additions and 16 deletions

View File

@ -6,7 +6,7 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/22 23:13:53 by edbernar #+# #+# */
/* Updated: 2024/09/29 23:17:04 by edbernar ### ########.fr */
/* Updated: 2024/10/01 02:34:55 by edbernar ### ########.fr */
/* */
/* ************************************************************************** */
@ -42,7 +42,7 @@ class Screen
tv.geometry.center();
this.tv = tv;
tv.position.set(0, 0.99, 2);
tv.material = new THREE.MeshPhysicalMaterial({color: 0xaaaaaa});
tv.material = new THREE.MeshPhysicalMaterial({color: 0x454545});
tv.material.roughness = 1;
tv.material.metalness = 1.05;
tv.scale.set(0.05, 0.05, 0.05);

View File

@ -6,7 +6,7 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/22 17:19:17 by edbernar #+# #+# */
/* Updated: 2024/09/30 23:07:19 by edbernar ### ########.fr */
/* Updated: 2024/10/01 02:34:34 by edbernar ### ########.fr */
/* */
/* ************************************************************************** */
@ -116,15 +116,19 @@ function home3D()
mouse = new THREE.Vector2();
isInFade = false;
spotLight = new THREE.SpotLight(0xffffff, 1000);
spotLight.position.set(0, 10, 0);
spotLight.angle = Math.PI / 6; // angle d'ouverture
spotLight.penumbra = 0.5;
spotLight.decay = 2;
spotLight.distance = 50;
spotLight.position.set(0, 3, -4);
spotLight.castShadow = true;
spotLight.rotateX(Math.PI / 2);
scene.add(spotLight);
spotLight.target = screen.screen;
if (Math.random() % 100 > 0.99)
video.pong = files.easterEggVideo;
newBgWall();
// newBgWall();
putObject(files.lampModel, -2.5, 0, 2.5, 3, 0, Math.PI + Math.PI / 8, 0);
putObject(files.plantModel, 1.5, 0, 3, 0.5, 0, 0, 0);
putObject(files.gameboyModel, -0.5, -0.075, 0.5, 0.1, 0, 0.4, 0);

View File

@ -6,7 +6,7 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/22 17:08:46 by madegryc #+# #+# */
/* Updated: 2024/09/30 23:46:19 by edbernar ### ########.fr */
/* Updated: 2024/10/01 01:01:09 by edbernar ### ########.fr */
/* */
/* ************************************************************************** */
@ -136,9 +136,9 @@ function startMode()
if (gameMode == 0)
startMultiLocal();
else if (gameMode == 1)
startMatchmaking();
startMatchmaking(false);
else if (gameMode == 2)
alert("Not implemented");
startMatchmaking(true);
else if (gameMode == 3)
alert("Not implemented");
}
@ -153,13 +153,13 @@ function startMultiLocal()
}, 500);
}
function startMatchmaking()
function startMatchmaking(ranked)
{
document.body.style.animation = "none";
document.body.style.animation = "startGameAnim 0.5s";
document.body.style.opacity = 0;
setTimeout(() => {
pageRenderer.changePage("waitingGamePage");
pageRenderer.changePage("waitingGamePage", false, ranked);
}, 500);
}

View File

@ -6,7 +6,7 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/14 21:20:45 by edbernar #+# #+# */
/* Updated: 2024/09/28 16:54:02 by edbernar ### ########.fr */
/* Updated: 2024/10/01 01:08:24 by edbernar ### ########.fr */
/* */
/* ************************************************************************** */
@ -31,7 +31,7 @@ class WaitingGamePage
{
document.body.children[i].style.animation = 'animShowMenuDiv 0.5s';
}
if (opponentInfo)
if (opponentInfo && typeof(opponentInfo) != 'boolean')
text = text.replace("other players", opponentInfo.username);
intervalPoints = setInterval(() => {
if (points.length < 3)
@ -41,10 +41,11 @@ class WaitingGamePage
sentence.innerText = text + points;
}, 500);
timeout = setTimeout(() => {
if (opponentInfo)
console.log("dsadsadas");
if (opponentInfo && typeof(opponentInfo) != 'boolean')
sendRequest("game", {action: 0, skinId: lastSelected ? lastSelected.id : 0, opponent: opponentInfo.id});
else
sendRequest("game", {action: 0, skinId: lastSelected ? lastSelected.id : 0});
sendRequest("game", {action: 0, skinId: lastSelected ? lastSelected.id : 0, isRanked: opponentInfo ? true : false});
timeout = null;
}, 1500);
returnButton.addEventListener('click', returnToLobby);