Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

223
Vistas
Click event not fired when clicking on canvas in Chrome during animation (works in Firefox)

My janky flying rat game

repository on github

Working on this janky little flying rat game.

I'm planning on having the rat shoot cheese bullets in the direction of the mouse pointer. I am adding click event listeners - currently on window, but will be on canvas afterwards.

The click event currently prints the mouse position to console

When I open the game, the click event fires and prints to console regardless of where I click.

Once the canvas switches from the introduction "page" to the actual game, the click event stops firing when clicking on the canvas - yet it keeps firing click events outside of the canvas.

This issue happens in Chrome. In Firefox there is no issue.

I also noticed that when looking at elements in chrome dev tools, once the introduction page ends, and the game starts, the body block (in "elements section") starts flickering. I'm thinking this may be related.

I can't see what is so different about how the introduction page canvas and the gameplay are animated/drawn to cause this issue.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda