Skip to content

Commit

Permalink
Add. evento de click para funcionar nos celulares
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardo committed Jul 23, 2024
1 parent 15aaaf2 commit 392047f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions projetos/projeto-dino-ia/dino.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,16 @@ window.addEventListener("keydown", (e) => {
}
});

// Início no PC
window.addEventListener("keydown", (e) => {if (e.code == 'Enter' && !jogoAtivo) {
reiniciarJogo();
// agenteSimples();
agenteModelo();
}});
// Início no celular
window.addEventListener("click", () => {if (!jogoAtivo) {
reiniciarJogo();
// agenteSimples();
agenteModelo();
}});
})();
7 changes: 7 additions & 0 deletions projetos/projeto-dino-ia/dinoAgenteSimples.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,16 @@ window.addEventListener("keydown", (e) => {
}
});

// Início no PC
window.addEventListener("keydown", (e) => {if (e.code == 'Enter' && !jogoAtivoAS) {
reiniciarJogoAS();
agenteSimplesAS();
// agenteModelo();
}});
// Início no celular
window.addEventListener("click", () => {if (!jogoAtivoAS) {
reiniciarJogoAS();
agenteSimplesAS();
// agenteModelo();
}});
})();

0 comments on commit 392047f

Please sign in to comment.