add tile merging
This commit is contained in:
@@ -4,8 +4,14 @@ function Tile(position, value) {
|
||||
this.value = value || 2;
|
||||
|
||||
this.previousPosition = null;
|
||||
this.mergedFrom = null; // Tracks tiles that merged together
|
||||
}
|
||||
|
||||
Tile.prototype.savePosition = function () {
|
||||
this.previousPosition = { x: this.x, y: this.y };
|
||||
};
|
||||
|
||||
Tile.prototype.updatePosition = function (position) {
|
||||
this.x = position.x;
|
||||
this.y = position.y;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user