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

225
Views
jQuery .each() hace que el lienzo parpadee

Estoy haciendo un juego en JavaScript. Cada vez que coloco un .each() para iterar a través de una lista de balas o enemigos, hace un parpadeo pequeño pero notable en la pantalla. ¿habría alguna forma de arreglar esto?

 function playing() { $.each(bullets, function (index, bullet) { //Makes tiny flicker. bullet.update(); }) } function update() { if (!gameOver) { %("menu").hide(); playing(); } else { $("#menu").show(); } setTimeout(update(), 6); } spawnE(); //spawns enemy update();

NOTA: Estoy usando setTimeout() en lugar de requestAnimationFrame() porque mantiene constante la velocidad del juego en diferentes frecuencias de actualización.

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

0

Encontré la respuesta. .each() de JQuery es simplemente más lento que .forEach() de javascript vainilla debido a que es una gran biblioteca.

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!