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

This commit is contained in:
synth-ruiner 2015-03-01 13:48:12 +00:00
commit 49f050cfe5
1 changed files with 11 additions and 10 deletions

View File

@ -164,21 +164,22 @@
if (rowsToRemove.length == 0) return; if (rowsToRemove.length == 0) return;
rowsToRemove.each(function() { rowsToRemove.each(function() {
score += $(this).children('.mine').length;
//add new row on bottom //add new row on bottom
$('#game').append('<ul style="display: none;"></ul>');
$('#game').append('<ul></ul>');
for (var i = 0; i < gameBoardWidth; i++) { for (var i = 0; i < gameBoardWidth; i++) {
if (Math.random() < mineChance) { if (Math.random() < mineChance) {
$('#game ul:last-child').append('<li class="mine"></li>'); $('#game ul').last().append('<li class="mine"></li>');
} else { } else {
$('#game ul:last-child').append('<li></li>'); $('#game ul').last().append('<li></li>');
} }
} }
}); });
inputEnabled = false; inputEnabled = false;
//rowsToRemove.remove();
rowsToRemove.slideUp("slow", function() { rowsToRemove.slideUp("slow", function() {
$(this).remove(); $(this).remove();
@ -205,17 +206,17 @@
$(this).addClass("revealed"); $(this).addClass("revealed");
}); });
inputEnabled = true;
//refresh last row to reflect new rows beneath //refresh last row to reflect new rows beneath
$('li.revealed').last().parent().children('li.revealed').mousedown(); $('li.revealed').last().parent().children('li.revealed').mousedown();
//click blank tiles //click blank tiles
$('li.revealed:not(.mine):empty').mousedown(); $('li.revealed:not(.mine):empty').mousedown();
//this is a bit of a hack :( oh well
$('ul:gt(' + gameBoardHeight + ')').remove();
}); });
$('ul:hidden').show(); inputEnabled = true;
} }
$.fn.rowScore = function() { $.fn.rowScore = function() {