Merge remote-tracking branch 'origin/master' into gh-pages

This commit is contained in:
synth-ruiner 2015-03-01 16:58:34 +00:00
commit d3effe7071
1 changed files with 16 additions and 4 deletions

View File

@ -25,7 +25,7 @@
} }
#game { #game {
background-color: #2b2113; background-color: #1b1c17;
float: left; float: left;
margin: 0 auto; margin: 0 auto;
height: 90vmin; height: 90vmin;
@ -74,13 +74,13 @@
float: left; float: left;
height: 8vmin; height: 8vmin;
width: 8vmin; width: 8vmin;
background-color: #8b969e; background-color: #454e52;
border-radius: 2vmin; border-radius: 2vmin;
cursor: default; cursor: default;
} }
li.revealed { li.revealed {
background-color: #2b2113; background-color: #1b1c17;
} }
li:not(.revealed):hover { li:not(.revealed):hover {
@ -136,6 +136,7 @@
var gameBoardWidth = 10; var gameBoardWidth = 10;
var gameBoardHeight = 9; var gameBoardHeight = 9;
var score = 0; var score = 0;
var bombs = 1;
var firstClick = true; var firstClick = true;
var currentlyIterating = false; var currentlyIterating = false;
var mineChance = 0.2; var mineChance = 0.2;
@ -247,6 +248,14 @@
inputEnabled = true; inputEnabled = true;
} }
function updateScore() {
$('#score').text("Score: " + score);
}
function updateMinesLeft() {
$('#mines').text("Mines left: " + $('.mine:not(.revealed):not(.flagged)').length);
}
$.fn.rowScore = function() { $.fn.rowScore = function() {
return $(this).children('.mine').length; return $(this).children('.mine').length;
} }
@ -416,6 +425,8 @@
} }
removeClearedRows(); removeClearedRows();
updateScore();
updateMinesLeft();
}); });
drawGameBoard(); drawGameBoard();
@ -426,7 +437,8 @@
<div id="game"></div> <div id="game"></div>
<div id="stats"> <div id="stats">
<div id="score">Score: 0</div> <div id="score">Score: 0</div>
<div id="bombs">Bombs: 0</div> <div id="bombs" style="display: none;">Bombs: 0</div>
<div id="mines">Mines left: 0</div>
</div> </div>
</body> </body>
</html> </html>