Game Merged

This commit is contained in:
Hugo Bourgeon
2024-08-07 16:26:54 +02:00
parent aa01b67037
commit c29bbe1ee1
3 changed files with 44 additions and 21 deletions

View File

@ -3,10 +3,10 @@
/* ::: :::::::: */
/* map.js :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: edbernar <edbernar@student.42.fr> +#+ +:+ +#+ */
/* By: hubourge <hubourge@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/30 13:50:51 by edbernar #+# #+# */
/* Updated: 2024/08/07 16:20:08 by edbernar ### ########.fr */
/* Updated: 2024/08/07 16:26:17 by hubourge ### ########.fr */
/* */
/* ************************************************************************** */
@ -21,8 +21,6 @@ function createMap(scene) {
wallUp = createWall(scene, 0, 0.25, -2.3, 0.1);
wallDown = createWall(scene, 0, 0.25, 2.3, 0.1);
boxLeft = createBox(scene, 0, 0.25, 0);
// boxRight = createBox(scene, 0, 0.25, 0);
ground = createGround(scene);
}
@ -50,18 +48,4 @@ function createGround(scene) {
return plane;
}
function createBox(scene, x, y, z)
{
const geometryBox = new THREE.BoxGeometry(1, 0.5, 0.1);
const materialBox = new THREE.MeshLambertMaterial({
color: 0xff0000,
});
const box = new THREE.Mesh(geometryBox, materialBox);
box.position.set(x, y, z);
box.rotateY(Math.PI / 2);
box.receiveShadow = true;
scene.add(box);
return box;
}
export { createMap };