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

253
Views
Colisión de color Javascript Snake Game Canvas no funciona

La colisión funciona de manera inconsistente, tratando de que funcione siempre. El siguiente código hace referencia a la colisión de colores que se usa para verificar si la serpiente se está golpeando a sí misma. También hay otras funciones en uso, pero creo que aquí es donde está ocurriendo el problema.

 function snakeCollide() { checkColour = ctx.getImageData(rx, ry, 1, 1).data; if (rdx > 0) { checkColour = ctx.getImageData(rx + rw + 1, ry + rh / 2, 1, 1).data; } else if (rdx < 0) { checkColour = ctx.getImageData(rx - 1, ry + rh / 2, 1, 1).data; } else if (rdy > 0) { checkColour = ctx.getImageData(rx + rw / 2, ry + rh + 1, 1, 1).data; } else if (rdy < 0) { checkColour = ctx.getImageData(rx + rw / 2, ry - 1, 1, 1).data; } else { console.log("TEST") } }
about 4 years ago · Juan Pablo Isaza
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!