Skip to content

Commit 0e2c78d

Browse files
committed
refactor: add debouncing
1 parent b47afe0 commit 0e2c78d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

050-insect catch game/script.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const addInsects = () => {
2323
};
2424

2525
const catchInsect = function () {
26+
if (this.classList.contains("caught")) return;
2627
increaseScore();
2728
this.classList.add("caught");
2829
setTimeout(() => this.remove, 2000);

0 commit comments

Comments
 (0)