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

This commit is contained in:
synth-ruiner 2015-03-09 23:45:53 +00:00
commit 83d9023ad9
1 changed files with 24 additions and 32 deletions

View File

@ -272,6 +272,18 @@
}
}
function newRow() {
var row = '<ul>';
for (var i = 0; i < gameBoardWidth; i++) {
row += newTile();
};
row += '</ul>';
return row;
}
$.fn.checkRow = function() {
//unclicked tiles
@ -316,30 +328,22 @@
return $(this).checkRow();
});
var numRowsToRemove = rowsToRemove.length;
if (numRowsToRemove == 0) return;
rowsToRemove.addClass("removing");
rowsToRemove.each(function() {
score += $(this).children('.mine').length;
});
rowsToRemove.slideUp("slow", function() {
$(this).remove();
//add new row on bottom
$(this).addClass("removing");
$('#game').append('<ul></ul>');
$(this).slideUp("slow", function() {
$(this).remove();
for (var i = 0; i < gameBoardWidth; i++) {
$('#game ul').last().append(newTile());
}
//add new row on bottom
$('#game').append(newRow());
refreshMineCounts();
refreshMineCounts();
//click blank tiles
$('li.revealed:not(.mine):empty').mouseup();
//click blank tiles
$('li.revealed:not(.mine):empty').mouseup();
});
});
}
@ -348,15 +352,11 @@
return $(this).checkColumn();
});
if (columnsToRemove.length == 0) return;
columnsToRemove.addClass("removing");
columnsToRemove.each(function() {
score += $(this).column().filter('.mine').length;
});
columnsToRemove.each(function() {
$(this).addClass("removing");
$(this).column().animate({width: 0, borderRadius: 0, padding: 0}, "slow", function() {
$(this).parent().append(newTile());
$(this).remove();
@ -446,15 +446,7 @@
}
$.fn.countMinesAdjacent = function() {
var count = 0;
$.each($(this).getAdjacentTiles(), function() {
if ($(this).isMine()) {
count++;
}
});
return count;
return $(this).getAdjacentTiles().filter('.mine').length;
}
$.fn.getAdjacentTiles = function() {