Skip to content

Commit

Permalink
refac: 一部修正
Browse files Browse the repository at this point in the history
  • Loading branch information
taga3s committed Aug 3, 2023
1 parent 0ceba85 commit 2412c7b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down Expand Up @@ -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];

Expand All @@ -89,7 +89,7 @@ function prepareBoard() {
function newGame() {
prepareBoard();
renderBoard();
var interval = setInterval(tick, 1000);
let intervalId = setInterval(tick, 1000);
}

let currentX = 0;
Expand Down

0 comments on commit 2412c7b

Please sign in to comment.