MCPcopy
hub / github.com/gabrielecirulli/2048 / Tile

Function Tile

js/tile.js:1–8  ·  view source on GitHub ↗
(position, value)

Source from the content-addressed store, hash-verified

1function Tile(position, value) {
2 this.x = position.x;
3 this.y = position.y;
4 this.value = value || 2;
5
6 this.previousPosition = null;
7 this.mergedFrom = null; // Tracks tiles that merged together
8}
9
10Tile.prototype.savePosition = function () {
11 this.previousPosition = { x: this.x, y: this.y };

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected