Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

164
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda