Skip to content

Commit

Permalink
correction shoot mobile (peut-être régler les contôles bientôt)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zakinane committed May 31, 2024
1 parent c887809 commit fa08a4f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion game/game.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,12 @@ if ("ontouchstart" in window) {
});

document.addEventListener("touchend", function (e) {
ShootUp();
const currentTime = Date.now();
const timeSinceLastShot = currentTime - lastShotTime;
if (timeSinceLastShot > 500) {
//latence
ShootUp();
lastShotTime = currentTime;
}
});
}

0 comments on commit fa08a4f

Please sign in to comment.