From 351e49c5b2e34143b7d8b43f30951d7e2fcc4763 Mon Sep 17 00:00:00 2001 From: synth-ruiner Date: Sun, 1 Mar 2015 15:59:06 +0000 Subject: [PATCH 1/2] Styling changes --- index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 274b574..282447d 100644 --- a/index.html +++ b/index.html @@ -25,7 +25,7 @@ } #game { - background-color: #2b2113; + background-color: #1b1c17; float: left; margin: 0 auto; height: 90vmin; @@ -74,13 +74,13 @@ float: left; height: 8vmin; width: 8vmin; - background-color: #8b969e; + background-color: #454e52; border-radius: 2vmin; cursor: default; } li.revealed { - background-color: #2b2113; + background-color: #1b1c17; } li:not(.revealed):hover { From 7af5e99f0a53acf4cbd3bb4c7781d4b0c524214c Mon Sep 17 00:00:00 2001 From: synth-ruiner Date: Sun, 1 Mar 2015 16:56:49 +0000 Subject: [PATCH 2/2] Add scoring and mine counter Scoring is a little buggy --- index.html | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 @@
Score: 0
-
Bombs: 0
+ +
Mines left: 0
\ No newline at end of file