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

287
Views
problemas para mover un ángulo de sprite del juego

Tengo un sprite de juego que quiero mover verticalmente, y normalmente esto sería fácil con this.x += number , excepto por el hecho de que las x/y del sprite son relativas a su ángulo. esto puede ser un poco confuso, así que tengo un ejemplo aquí. ingrese la descripción de la imagen aquí

en otros casos, donde la imagen no se cargará de otra cosa, tengo un enlace de imagen de ejemplo

puede ser un poco largo aquí está el código básico

 this.update = function() { ctx = myGameArea.context; if (type == "image") { ctx.save(); ctx.translate(300, 200); ctx.rotate(this.angle); ctx.translate(this.x, this.y) ctx.drawImage(this.image, this.width / -2, this.height/ -2, this.width, this.height); ctx.restore(); }else { ctx.save(); ctx.translate(this.x, this.y); ctx.rotate(this.angle); ctx.fillStyle = color; ctx.fillRect(this.width / -2, this.height / -2, this.width, this.height); ctx.restore(); } } function framethingupdate() { gamething.update(); }

debido a ciertos problemas, no puedo ejecutar o proporcionar una demostración, sin embargo, si se necesita el código completo, puede encontrarlo aquí: código completo

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!