/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* Map.js :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: edbernar -this.mapLength + 1) this.arrObject[i].mesh.position.z = ball.position.z; this.arrObject[i].mesh.position.y = ball.position.y; } if (this.arrObject[i].name == "wallRight") { if (ball.position.z < 0.1 && ball.position.z > -this.mapLength + 1) this.arrObject[i].mesh.position.z = ball.position.z; this.arrObject[i].mesh.position.y = ball.position.y; } if (this.arrObject[i].name == "wallLeft") { let diff = ball.position.x - this.arrObject[i].mesh.position.x - 0.1; if (diff > 2) this.arrObject[i].mesh.material.opacity = 0; else this.arrObject[i].mesh.material.opacity = 1 - (diff / 2); } if (this.arrObject[i].name == "wallRight") { let diff = this.arrObject[i].mesh.position.x - ball.position.x - 0.1; if (diff > 2) this.arrObject[i].mesh.material.opacity = 0; else this.arrObject[i].mesh.material.opacity = 1 - (diff / 2); } } } }; export { Map };