Skip to content

Commit

Permalink
feat(gameplay): add arrow key support for choices
Browse files Browse the repository at this point in the history
  • Loading branch information
stevensoyuz committed Jul 27, 2024
1 parent ef2594f commit f145a80
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,14 @@ document.addEventListener("DOMContentLoaded", () => {

beforeButton.addEventListener("click", () => handleChoice(false));
afterButton.addEventListener("click", () => handleChoice(true));

document.addEventListener("keydown", (event) => {
if (event.key === "ArrowLeft") {
handleChoice(false);
}
if (event.key === "ArrowRight") {
handleChoice(true);
}
});
}
});

0 comments on commit f145a80

Please sign in to comment.