Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions webclient/public/js/game_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,12 +461,13 @@ GameManager.prototype.getMaxTile = function() {

// Determine whether a tile of value >= 2048 exists
GameManager.prototype.hasWon = function () {
var won = false;
this.grid.eachCell(function (x, y, tile) {
if (tile && tile >= 2048) {
return true;
if (tile && tile.value >= 2048) {
won = true;
}
});
return false;
return won;
};

GameManager.prototype.positionsEqual = function (first, second) {
Expand Down
Loading