From d00d5cfcd34edb1c0063d9f5929f72d5bead3637 Mon Sep 17 00:00:00 2001 From: Osrepnay <44347902+Osrepnay@users.noreply.github.com> Date: Thu, 4 Jun 2020 11:00:20 -0500 Subject: [PATCH] Removed invisible dead blocks When the blocks reach the top and the player/program dies, the dead blocks aren't cleared --- sketch.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sketch.js b/sketch.js index 579c1b7..4f797f2 100644 --- a/sketch.js +++ b/sketch.js @@ -51,7 +51,7 @@ function draw() { for (let j = 0; j < gameHeight; j++) { column.push(null); } - deadBlocksMatrix.push(column); + deadBlocksMatrix[i]=column; } deadBlocks = []; currentShape = new Shape(getRandomShapeID(), createVector(floor(random(1, gameWidth - 2)), 0)); @@ -85,4 +85,4 @@ function drawGrid() { line(0, j * BLOCK_SIZE, canvas.width, j * BLOCK_SIZE); } pop(); -} \ No newline at end of file +}