From 2412c7bb99257857dddcd612aa5de436a5eb8947 Mon Sep 17 00:00:00 2001 From: seiya_tagami Date: Thu, 3 Aug 2023 22:59:16 +0900 Subject: [PATCH] =?UTF-8?q?refac:=20=E4=B8=80=E9=83=A8=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/main.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/main.js b/scripts/main.js index 5a15be0..e5bec5c 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -3,10 +3,10 @@ // board rendering config const H = 600; const W = 300; -const ROWS = 20; -const COLS = 10; // block rendering config +const ROWS = 20; +const COLS = 10; const BLOCK_H = H / ROWS; const BLOCK_W = W / COLS; const shapes = [ @@ -65,7 +65,7 @@ canvas.height = H; canvas.classList.add("canvas"); const ctx = canvas.getContext("2d"); -const board = []; +let board = []; const randomIndex = Math.floor(Math.random() * shapes.length); const currentShape = shapes[randomIndex]; @@ -89,7 +89,7 @@ function prepareBoard() { function newGame() { prepareBoard(); renderBoard(); - var interval = setInterval(tick, 1000); + let intervalId = setInterval(tick, 1000); } let currentX = 0;