From 10962c4da037a6236d28baa5341f9fd6ac0ac82c Mon Sep 17 00:00:00 2001 From: Luna Date: Wed, 4 Aug 2021 17:20:21 -0700 Subject: [PATCH] Simplified some code. --- sketch.js | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/sketch.js b/sketch.js index a92f2ef..12d6d12 100644 --- a/sketch.js +++ b/sketch.js @@ -85,18 +85,8 @@ function draw() { //ADDING SCORE WHEN BALL HITS TILES - if (j === 5) { - score += 1 - } else if (j === 4) { - score += 2 - } else if (j === 3) { - score += 3 - } else if (j === 2) { - score += 4 - } else if (j === 1) { - score += 5 - } else if (j === 0) { - score += 6 + if (j >= 0 && j <= 6) { + score += 6 - j } }