Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

158
Vistas
El juego Text Adventure no muestra elementos de texto

Soy un programador principiante y estoy intentando crear una aventura de texto con javascript, sin embargo, el texto no se muestra y no pude encontrar ningún error obvio. ¿Podría alguien ayudarme?

js const textElement = document.getElementById('texto') const optionButtonsElement = document.getElementById('option-buttons')

 let state = {} function startGame() { state = {} showTextNode(1) } function showTextNode(textNodeIndex) { const textNode = textNodes.find(textNode.id === textNodeIndex) textElement.innerText = textNode.text while (optionButtonsElement.firstChild) { optionButtonsElement.removeChild(optionButtonsElement.firstChild) } function selectOption(option) { } const textNodes = [ { id: 1, text: "You wake up in a room you've never seen before. Getting out of bed, you note the silver, almost royal, color scheme of the room.", option: [ { text: 'Examine the Room', setState: { RoomKnowledge: true }, nextText: 2 } ] } { id: 2 } ] startGame()

html

 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Test</title> <link rel="stylesheet" href="style.css"> <script src="game.js"></script> </head> <body> <div class="container"> <div id="text"></div> <div id="option-buttons" class="btn-grid"> <button class="btn">Option 1</button> <button class="btn">Option 2</button> <button class="btn">Option 3</button> <button class="btn">Option 4</button> </div> </div> </body> </html>
about 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda