Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

222
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda