diff --git a/lobby.js b/lobby.js index 9f718c1..c5795b4 100644 --- a/lobby.js +++ b/lobby.js @@ -1,49 +1,39 @@ +// lobby.js + +// Importa las funciones necesarias de cuestionario.js import { loadQuizScene } from './cuestionario.js'; -// Escena del Lobby -const sceneLobby = new THREE.Scene(); -const cameraLobby = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000); -const renderer = new THREE.WebGLRenderer({ antialias: true }); -renderer.setSize(window.innerWidth, window.innerHeight); -document.body.appendChild(renderer.domElement); -// Crear el cubo de la escena del lobby -const geometryLobby = new THREE.BoxGeometry(); -const materialLobby = new THREE.MeshBasicMaterial({ color: 0x007BFF }); -const cubeLobby = new THREE.Mesh(geometryLobby, materialLobby); -sceneLobby.add(cubeLobby); +// Función que se ejecuta cuando se carga la escena de lobby +export function loadLobbyScene() { + // Crea el contenedor para la interfaz de lobby + const lobbyContainer = document.createElement('div'); + lobbyContainer.id = 'lobby-container'; + document.body.appendChild(lobbyContainer); -cameraLobby.position.z = 5; + // Título del lobby + const title = document.createElement('h1'); + title.innerText = 'Bienvenido al Juego'; + lobbyContainer.appendChild(title); -// Mostrar texto de instrucciones (canvas 2D sobre la escena 3D) -const lobbyContainer = document.createElement('div'); -lobbyContainer.style.position = 'absolute'; -lobbyContainer.style.top = '50%'; -lobbyContainer.style.left = '50%'; -lobbyContainer.style.transform = 'translate(-50%, -50%)'; -lobbyContainer.style.textAlign = 'center'; -lobbyContainer.innerHTML = ` -