From 79b023829f16506fa8ab9028fc9895f0e20ac1fe Mon Sep 17 00:00:00 2001 From: Yewon Date: Sun, 18 May 2025 23:16:27 +0900 Subject: [PATCH] Adding keyPressed function - reset score --- src/main.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.js b/src/main.js index fdfc9ac..621e8ae 100644 --- a/src/main.js +++ b/src/main.js @@ -52,6 +52,11 @@ function mousePressed() { function keyPressed() { if (key === ' ') { // reset score and targets + gun.remainingShots = TOT_SHOTS; + score.shotLeft = TOT_SHOTS; + + score.score = 0; + } }