1
0
forked from sent/waves
waves-fork/public/assets/g/flap/js/tile.js
2025-04-09 17:11:14 -05:00

18 lines
455 B
JavaScript

function Tile(position, value) {
this.x = position.x;
this.y = position.y;
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;
};