diff --git a/index.html b/index.html index 282447d..45f3d63 100644 --- a/index.html +++ b/index.html @@ -136,6 +136,7 @@ var gameBoardWidth = 10; var gameBoardHeight = 9; var score = 0; + var bombs = 1; var firstClick = true; var currentlyIterating = false; var mineChance = 0.2; @@ -247,6 +248,14 @@ inputEnabled = true; } + function updateScore() { + $('#score').text("Score: " + score); + } + + function updateMinesLeft() { + $('#mines').text("Mines left: " + $('.mine:not(.revealed):not(.flagged)').length); + } + $.fn.rowScore = function() { return $(this).children('.mine').length; } @@ -416,6 +425,8 @@ } removeClearedRows(); + updateScore(); + updateMinesLeft(); }); drawGameBoard(); @@ -426,7 +437,8 @@