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

106
Views
RequestAnimationFrame está cambiando parámetros

Estoy creando un juego de desplazamiento lateral y tengo problemas con window.requestAnimationFrame. Estoy creando una función que recorre el juego y la exporta. Cuando llamo a esta función en lugar de registrar el objeto del jugador, registra un valor flotante.

juegoLoop.js

 export default function gameLoop(player){ window.requestAnimationFrame(gameLoop); console.log(player); }

principal.js

 import Player from "./player.js"; import gameLoop from "./gameLoop.js"; const canvas = document.getElementById("canvas"); canvas.width = window.innerWidth; canvas.height = window.innerHeight; let ctx = canvas.getContext("2d"); let player = new Player(30,canvas.height - 100,ctx); gameLoop(player);
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!