Skip to content

Commit 04bc524

Browse files
committed
fix: increased difficulty
1 parent a13fc81 commit 04bc524

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

050-insect catch game/script.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ const increaseScore = () => {
2121
if (score > 19) message.classList.add("visible");
2222
scoreElement.innerHTML = `Score: ${score}`;
2323
// Increase Game Difficulty Over Time
24-
addInsects(score > 10 ? 2 : 1);
24+
const insectsToAdd = Math.min(1 + Math.floor(score / 10), 5);
25+
addInsects(insectsToAdd);
2526
};
2627

2728
const addInsects = (count = 1) => {

0 commit comments

Comments
 (0)