Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

226
Views
Contador de puntos de JavaScript para un juego tipo serpiente html

Soy nuevo en el aprendizaje de JavaScript, he buscado en muchos sitios web y hasta ahora no puedo encontrar una solución.

Estoy haciendo un minijuego sobre una base de serpiente. ¿Alguien puede ayudarme a hacer un contador de puntos usando javascript y html?

¡Puedes ver el juego aquí!

https://github.com/LiquidSlime/Gusano-juego

y me gustaría hacerlo usando

 <div id="points"<h1></h1></div> and javascript; var element = document.getElementById("points") **Code here**;

¡Ojalá alguien pueda ayudarme!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puedes hacer un lapso con los puntos de identificación.

 <span id=points>? Points</span>

Luego en js cambia el innnerText

 const pointElement = document.getElementById('points') function updatePoints(points) { pointElement.innerText = points + ' Points' }

Luego ejecuta los puntos de actualización.

 updatePoints(1) // If you want to load if from another varible // get points from somewhere else updatePoints(points)

Cuando quieras que actualice algo sería así en tu código

 points++; updatePoints(points)
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!