diff --git a/app.js b/app.js index c1bfb48..12dd0e4 100644 --- a/app.js +++ b/app.js @@ -105,6 +105,7 @@ document.addEventListener('DOMContentLoaded', () => { function freeze() { if(current.some(index => squares[currentPosition + index + width].classList.contains('taken'))) { current.forEach(index => squares[currentPosition + index].classList.add('taken')) + addScore() //start a new tetromino falling random = nextRandom nextRandom = Math.floor(Math.random() * theTetrominoes.length) @@ -112,7 +113,6 @@ document.addEventListener('DOMContentLoaded', () => { currentPosition = 4 draw() displayShape() - addScore() gameOver() } }